1--TEST-- 2Dynamic property shadowed by private property 3--FILE-- 4<?php 5 6class Test { 7 private $prop = "Test"; 8 9 function run() { 10 foreach ($this as $k => $v) { 11 echo "$k => $v\n"; 12 } 13 var_dump(get_object_vars($this)); 14 } 15} 16class Test2 extends Test { 17} 18 19$test2 = new Test2; 20$test2->prop = "Test2"; 21$test2->run(); 22 23?> 24--EXPECT-- 25prop => Test 26array(1) { 27 ["prop"]=> 28 string(4) "Test" 29} 30