3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function welcome(string $name) { echo 'Hello ' . $name; } welcome(2);
based on WSiPF
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to welcome() must be of the type string, integer given, called in /in/CWq9h on line 8 and defined in /in/CWq9h:4 Stack trace: #0 /in/CWq9h(8): welcome(2) #1 {main} thrown in /in/CWq9h on line 4
Process exited with code 255.
Output for 5.3.20 - 5.6.21
Warning: Unsupported declare 'strict_types' in /in/CWq9h on line 2 Catchable fatal error: Argument 1 passed to welcome() must be an instance of string, integer given, called in /in/CWq9h on line 8 and defined in /in/CWq9h on line 4
Process exited with code 255.