3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); if (version_compare(PHP_VERSION, "7.0", "<")) die(); function foo(int $a) { var_dump($a); } foo(123.5); foo("123.5"); foo("132abc"); foo("apple");
based on UOBDp
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type integer, float given, called in /in/NFYmH on line 10 and defined in /in/NFYmH:6 Stack trace: #0 /in/NFYmH(10): foo(123.5) #1 {main} thrown in /in/NFYmH on line 6
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/NFYmH on line 1