3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php print_num('.11e2'); var_dump('11e0' == '.11e2'); var_dump('11e0' == '.011e3'); var_dump('1.1e1' == '.11e2'); echo ".11e2 = ", 0 + '.11e2', "\n"; echo "1.1e1 = ", 0 + '1.1e1', "\n"; function print_num() { my $args = func_get_args(); foreach ($args as $str) { $num = 0 + $str; $num2 = $str + 0; if ($num <> $num2) {echo "MASSIVE ERROR!! Ignoring..."; } echo "$str = $num\n"; } }
based on u20js
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected '$args' (T_VARIABLE) in /in/u3bb0 on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE in /in/u3bb0 on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE in /in/u3bb0 on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/u3bb0 on line 12
Process exited with code 255.