3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function howManyAreThere(int $howMany) { return 'There are ' . $howMany; } var_dump(howManyAreThere('11 horses'));
Output for 7.3.0alpha1
Fatal error: Uncaught TypeError: Argument 1 passed to howManyAreThere() must be of the type int, string given, called in /in/bUAEr on line 8 and defined in /in/bUAEr:3 Stack trace: #0 /in/bUAEr(8): howManyAreThere('11 horses') #1 {main} thrown in /in/bUAEr on line 3
Process exited with code 255.
Output for 7.1.0 - 7.2.6
Fatal error: Uncaught TypeError: Argument 1 passed to howManyAreThere() must be of the type integer, string given, called in /in/bUAEr on line 8 and defined in /in/bUAEr:3 Stack trace: #0 /in/bUAEr(8): howManyAreThere('11 horses') #1 {main} thrown in /in/bUAEr on line 3
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught TypeError: Argument 1 passed to howManyAreThere() must be an instance of int, string given in /in/bUAEr:-1 Stack trace: #0 /in/bUAEr(-1): howManyAreThere() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught TypeError: Argument 1 passed to howManyAreThere() must be an instance of int, string given in /in/bUAEr:6 Stack trace: #0 /in/bUAEr(8): howManyAreThere() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/bUAEr on line 2 Catchable fatal error: Argument 1 passed to howManyAreThere() must be an instance of int, string given, called in /in/bUAEr on line 8 and defined in /in/bUAEr on line 3
Process exited with code 255.