3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public $foo = 'bar'; function __construct() { $this->mememe = $this; } } $foo = new Foo; print_r($foo); var_dump($foo); var_export($foo);
Output for 5.4.7 - 5.6.28, 7.0.0 - 7.1.0
Foo Object ( [foo] => bar [mememe] => Foo Object *RECURSION* ) object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> *RECURSION* } Warning: var_export does not handle circular references in /in/LIk8U on line 14 Foo::__set_state(array( 'foo' => 'bar', 'mememe' => NULL, ))
Output for hhvm-3.12.0
Foo Object ( [foo] => bar [mememe] => Foo Object ( [foo] => bar [mememe] => Array *RECURSION* ) ) object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> *RECURSION* } Fatal error: Nesting level too deep - recursive dependency? in /in/LIk8U on line 14
Process exited with code 255.
Output for hhvm-3.10.0
Foo Object ( [foo] => bar [mememe] => Foo Object ( [foo] => bar [mememe] => Array *RECURSION* ) ) object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> *RECURSION* } Fatal error: Nesting level too deep - recursive dependency? in /in/LIk8U on line -1
Process exited with code 255.
Output for 5.2.14 - 5.2.17, 5.3.3 - 5.4.6
Foo Object ( [foo] => bar [mememe] => Foo Object *RECURSION* ) object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> *RECURSION* } Fatal error: Nesting level too deep - recursive dependency? in /in/LIk8U on line 14
Process exited with code 255.
Output for 5.1.0 - 5.2.13, 5.3.0 - 5.3.2
Foo Object ( [foo] => bar [mememe] => Foo Object *RECURSION* ) object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> *RECURSION* } } Foo::__set_state(array( 'foo' => 'bar', 'mememe' => Foo::__set_state(array( 'foo' => 'bar', 'mememe' => Foo::__set_state(array( 'foo' => 'bar', 'mememe' => Foo::__set_state(array( Fatal error: Nesting level too deep - recursive dependency? in /in/LIk8U on line 14
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Foo Object ( [foo] => bar [mememe] => Foo Object *RECURSION* ) object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> object(Foo)#1 (2) { ["foo"]=> string(3) "bar" ["mememe"]=> *RECURSION* } } class Foo { public $foo = 'bar'; public $mememe = class Foo { public $foo = 'bar'; public $mememe = class Foo { public $foo = 'bar'; public $mememe = class Foo { Fatal error: Nesting level too deep - recursive dependency? in /in/LIk8U on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LIk8U on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LIk8U on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/LIk8U on line 4
Process exited with code 255.