3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); class Cheese { public function foo($bar, int $baz) { echo $baz; } } (new Cheese())->foo('bar');
based on 1tgOo
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Cheese::foo(), 1 passed in /in/dtTLm on line 13 and exactly 2 expected in /in/dtTLm:7 Stack trace: #0 /in/dtTLm(13): Cheese->foo('bar') #1 {main} thrown in /in/dtTLm on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Fatal error: Uncaught TypeError: Argument 2 passed to Cheese::foo() must be of the type integer, none given, called in /in/dtTLm on line 13 and defined in /in/dtTLm:7 Stack trace: #0 /in/dtTLm(13): Cheese->foo('bar') #1 {main} thrown in /in/dtTLm on line 7
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/dtTLm on line 3 Catchable fatal error: Argument 2 passed to Cheese::foo() must be an instance of int, none given, called in /in/dtTLm on line 13 and defined in /in/dtTLm on line 7
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Warning: Unsupported declare 'strict_types' in /in/dtTLm on line 3 Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/dtTLm on line 13
Process exited with code 255.