mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
25 lines
331 B
PHP
25 lines
331 B
PHP
--TEST--
|
|
Bug #41929 (Foreach on object does not iterate over all visible properties)
|
|
--FILE--
|
|
<?php
|
|
class C {
|
|
private $priv = "ok";
|
|
|
|
function doLoop() {
|
|
echo $this->priv,"\n";
|
|
foreach ($this as $k=>$v) {
|
|
echo "$k: $v\n";
|
|
}
|
|
}
|
|
}
|
|
|
|
class D extends C {
|
|
}
|
|
|
|
$myD = new D;
|
|
$myD->doLoop();
|
|
?>
|
|
--EXPECT--
|
|
ok
|
|
priv: ok
|