3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = new \StdClass; $bar = new \StdClass; $foo->bar = $bar; $bar->foo = $foo; $array = array('foo' => $foo, 'bar' => $bar); $hash = array(); rwalk($array); function rwalk($array) { if (is_array($array)) { foreach ($array as $key => $value) { if (is_object($value)) { $objHash = spl_object_hash($value); $value = (array) $value; } if (is_array($value) && !in_array($objHash, $hash)) { $hash[] = $objHash; //rwalk($value); } else echo "REC" } } }
Output for 5.3.0 - 5.4.27
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/O0aJ7 on line 25
Process exited with code 255.