3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new stdClass();$b = new stdClass();$a->child = $b;$b->parent = $a;var_dump($a);var_export($a);?>
Output for 5.4.7 - 7.1.0
object(stdClass)#1 (1) { ["child"]=> object(stdClass)#2 (1) { ["parent"]=> *RECURSION* } } Warning: var_export does not handle circular references in /in/uTdG0 on line 1 stdClass::__set_state(array( 'child' => stdClass::__set_state(array( 'parent' => NULL, )), ))
Output for 5.2.14 - 5.2.17, 5.3.3 - 5.4.6
object(stdClass)#1 (1) { ["child"]=> object(stdClass)#2 (1) { ["parent"]=> *RECURSION* } } Fatal error: Nesting level too deep - recursive dependency? in /in/uTdG0 on line 1
Process exited with code 255.
Output for 5.1.0 - 5.2.13, 5.3.0 - 5.3.2
object(stdClass)#1 (1) { ["child"]=> object(stdClass)#2 (1) { ["parent"]=> object(stdClass)#1 (1) { ["child"]=> object(stdClass)#2 (1) { ["parent"]=> *RECURSION* } } } } stdClass::__set_state(array( 'child' => stdClass::__set_state(array( 'parent' => stdClass::__set_state(array( 'child' => stdClass::__set_state(array( 'parent' => stdClass::__set_state(array( 'child' => stdClass::__set_state(array( 'parent' => stdClass::__set_state(array( Fatal error: Nesting level too deep - recursive dependency? in /in/uTdG0 on line 1
Process exited with code 255.
Output for 5.0.0 - 5.0.5
object(stdClass)#1 (1) { ["child"]=> object(stdClass)#2 (1) { ["parent"]=> object(stdClass)#1 (1) { ["child"]=> object(stdClass)#2 (1) { ["parent"]=> *RECURSION* } } } } class stdClass { public $child = class stdClass { public $parent = class stdClass { public $child = class stdClass { public $parent = class stdClass { public $child = class stdClass { public $parent = class stdClass { Fatal error: Nesting level too deep - recursive dependency? in /in/uTdG0 on line 1
Process exited with code 255.
Output for 4.3.0 - 4.4.9
object(stdClass)(1) { ["child"]=> object(stdClass)(0) { } } class stdClass { var $child = class stdClass { }; }