Populate an object after unserialization in Symfony

Code
<?php

use Symfony\Component\Serializer\Serializer;
use 
Symfony\Component\Serializer\Encoder\JsonEncoder;
use 
Symfony\Component\Serializer\Normalizer\PropertyNormalizer;

$jsonEncoder = new JsonEncoder();
$normalizer = new PropertyNormalizer();

$serializer = new Serializer([$normalizer], [$jsonEncoder]);

$array = ['id' => 1'foo' => 'bar'];

class 
Foo
{
    private 
$id;
    private 
$foo;
}

$serialized $serializer->serialize($array'json');

$foo = new Foo();

$unserialized $serializer->deserialize(
    
$serialized,
    
Foo::class,
    
'json'
    [
        
'object_to_populate' => $foo,
    ]
);

dump(
    
$unserialized === $foo,
    
$unserialized
);
Result
^ true

^ Foo {#1397
-id: 1
-foo: "bar"
}
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8