Closed
Description
Description
The following code produces the expected output on PHP < 8.1, but breaks on PHP >=8.1 see https://3v4l.org/L9WpO
class Foo
{
public $foo;
}
function hydrate($properties, $object)
{
foreach ($properties as $name => &$value) {
$object->$name = &$value;
}
};
$object = new Foo;
hydrate(['foo' => 123], $object);
var_dump(ReflectionReference::fromArrayElement((array) $object, 'foo'));
Resulted in this output:
object(ReflectionReference)#2 (0) {
}
But I expected this output instead:
NULL
PHP Version
8.1
Operating System
No response