3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Cheese { public function foo($bar, $baz) { echo $baz; } } (new Cheese())->foo('bar');
based on 0SujW
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Cheese::foo(), 1 passed in /in/1tgOo on line 11 and exactly 2 expected in /in/1tgOo:5 Stack trace: #0 /in/1tgOo(11): Cheese->foo('bar') #1 {main} thrown in /in/1tgOo on line 5
Process exited with code 255.
Output for 5.4.0 - 7.0.20
Warning: Missing argument 2 for Cheese::foo(), called in /in/1tgOo on line 11 and defined in /in/1tgOo on line 5 Notice: Undefined variable: baz in /in/1tgOo on line 7
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/1tgOo on line 11
Process exited with code 255.