3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $a = ['a','b','c']; } $test = new A; $a = (array) $test; foreach($a as $k=>$v){ echo $k; echo var_dump($v); }
based on H0tMJ
Output for 5.5.0 - 7.3.0rc4
Aaarray(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }