php-src/Zend/tests/bug41929.phpt

25 lines
331 B
Plaintext
Raw Normal View History

--TEST--
2007-09-19 19:25:22 +08:00
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";
}
2018-09-17 01:16:42 +08:00
}
}
class D extends C {
}
$myD = new D;
$myD->doLoop();
?>
--EXPECT--
ok
priv: ok