- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27
- Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/O0aJ7 on line 25
Process exited with code 255.
<?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"
}
}
}