3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Object { public $foo = 'public'; protected $bar = 'bar'; public function callLoopInternally() { echo \PHP_EOL; echo '---For reals internal---', \PHP_EOL; $this->doLoopInternally(); } public function doLoopInternally() { echo '------Iterating Internally-------', \PHP_EOL; foreach($this as $prop => $val) { echo $prop, ':', $val, \PHP_EOL; } } } echo '------Iterating Externally-------', \PHP_EOL; $obj = new Object(); foreach($obj as $prop => $val) { echo $prop, ':', $val, \PHP_EOL; } $obj->doLoopInternally();

This is an error 404

There are `0` results


preferences:
142.16 ms | 1399 KiB | 7 Q