3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function __construct() { $this->herp = 'derp'; } function bar() { return $this->herp(); } function baz() { $x = $this->bar(); var_dump(func_get_args()); var_dump($x); } } (new Foo())->baz(1,2,3);
based on vW8ie
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined method Foo::herp() in /in/d0YAq:9 Stack trace: #0 /in/d0YAq(12): Foo->bar() #1 /in/d0YAq(18): Foo->baz(1, 2, 3) #2 {main} thrown in /in/d0YAq on line 9
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined method Foo::herp() in /in/d0YAq on line 9
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/d0YAq on line 18
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/d0YAq on line 18
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/d0YAq on line 18
Process exited with code 255.