3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(int $i) { echo $i; } foo("I'm a string");
based on RO9uT
Output for 7.3.0alpha1 - 7.3.0rc3
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type int, string given, called in /in/BnbkV on line 7 and defined in /in/BnbkV:3 Stack trace: #0 /in/BnbkV(7): foo('I'm a string') #1 {main} thrown in /in/BnbkV on line 3
Process exited with code 255.
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type integer, string given, called in /in/BnbkV on line 7 and defined in /in/BnbkV:3 Stack trace: #0 /in/BnbkV(7): foo('I'm a string') #1 {main} thrown in /in/BnbkV on line 3
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be an instance of int, string given in /in/BnbkV:5 Stack trace: #0 /in/BnbkV(7): foo() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to foo() must be an instance of int, string given, called in /in/BnbkV on line 7 and defined in /in/BnbkV on line 3
Process exited with code 255.