mirror of
https://github.com/php/php-src.git
synced 2024-12-25 01:40:50 +08:00
149e6aaa99
A dynamic property may be shadowed by a private/protected property. Make sure we check property accessibility for non-indirect properties as well. Closes #3626.
30 lines
427 B
PHP
30 lines
427 B
PHP
--TEST--
|
|
Dynamic property shadowed by private property
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
private $prop = "Test";
|
|
|
|
function run() {
|
|
foreach ($this as $k => $v) {
|
|
echo "$k => $v\n";
|
|
}
|
|
var_dump(get_object_vars($this));
|
|
}
|
|
}
|
|
class Test2 extends Test {
|
|
}
|
|
|
|
$test2 = new Test2;
|
|
$test2->prop = "Test2";
|
|
$test2->run();
|
|
|
|
?>
|
|
--EXPECT--
|
|
prop => Test
|
|
array(1) {
|
|
["prop"]=>
|
|
string(4) "Test"
|
|
}
|