3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types = 1); function hello(string $s) : void { echo "$s\n"; } function fourtyTwo() : int { return "42"; } hello(1234); fourtyTwo();
Output for 7.1.7
Fatal error: Uncaught TypeError: Argument 1 passed to hello() must be of the type string, integer given, called in /in/15Ypa on line 12 and defined in /in/15Ypa:4 Stack trace: #0 /in/15Ypa(12): hello(1234) #1 {main} thrown in /in/15Ypa on line 4
Process exited with code 255.