mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
49 lines
670 B
PHP
49 lines
670 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
|
|
)
|
|
|
|
)
|
|
|
|
)
|