php-src/Zend/tests/bug71336.phpt
2020-02-03 22:52:20 +01:00

49 lines
742 B
PHP

--TEST--
Bug #71336 (Wrong is_ref on properties as exposed via get_object_vars())
--FILE--
<?php
class A
{
protected $bar = array('baz');
function bar()
{
array_pop($this->bar);
$vars = get_object_vars($this);
$this->bar[] = array('buz');
print_r($vars);
}
function foo() {
array_pop($this->bar);
$dummy = &$this->bar;
$vars = get_object_vars($this);
$this->bar[] = array('buz');
print_r($vars);
}
}
(new A())->bar();
(new A())->foo();
?>
--EXPECT--
Array
(
[bar] => Array
(
)
)
Array
(
[bar] => Array
(
[0] => Array
(
[0] => buz
)
)
)