3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (version_compare(PHP_VERSION, "7.0", "<")) die(); declare(strict=1); 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
Warning: Unsupported declare 'strict' in /in/OvN4O on line 5 int(123) int(123) Notice: A non well formed numeric value encountered in /in/OvN4O on line 6 int(132) Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type integer, string given, called in /in/OvN4O on line 13 and defined in /in/OvN4O:6 Stack trace: #0 /in/OvN4O(13): foo('apple') #1 {main} thrown in /in/OvN4O on line 6
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Warning: Unsupported declare 'strict' in /in/OvN4O on line 5