xref: /PHP-7.2/Zend/tests/bug41929.phpt (revision 17ccbeec)
1--TEST--
2Bug #41929 (Foreach on object does not iterate over all visible properties)
3--FILE--
4<?php
5class C {
6  private $priv = "ok";
7
8  function doLoop() {
9    echo $this->priv,"\n";
10    foreach ($this as $k=>$v) {
11      echo "$k: $v\n";
12    }
13  }
14}
15
16class D extends C {
17}
18
19$myD = new D;
20$myD->doLoop();
21?>
22--EXPECT--
23ok
24priv: ok
25