run code in 200+ php & hhvm versions
Bugs & Features
<?php if (version_compare(PHP_VERSION, "7.0", "<")) die(); function foo(float $a) { var_dump($a); } foo(123); foo("123.5"); foo("132abc"); foo("apple");
based on UOBDp
Output for 7.0.0 - 7.3.1
float(123) float(123.5) Notice: A non well formed numeric value encountered in /in/XHKJU on line 6 float(132) Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type float, string given, called in /in/XHKJU on line 13 and defined in /in/XHKJU:6 Stack trace: #0 /in/XHKJU(13): foo('apple') #1 {main} thrown in /in/XHKJU on line 6
Process exited with code 255.
Output for 5.3.20 - 5.6.28