1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/bugGH-8655.phpt
2022-06-09 13:28:12 +02:00

30 lines
491 B
PHP

--TEST--
Bug GH-8655 (zval reference is not released when targetting a declared property)
--FILE--
<?php
class Foo
{
public $foo;
}
function hydrate($properties, $object)
{
foreach ($properties as $name => &$value) {
$object->$name = &$value;
}
};
$object = new Foo;
hydrate(['foo' => 123], $object);
$arrayCast = (array) $object;
$object->foo = 234;
var_dump(ReflectionReference::fromArrayElement($arrayCast, 'foo'));
echo $arrayCast['foo'];
?>
--EXPECT--
NULL
123