3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php print_num('.11e2', '1.1e1', '.011e3', '0.11e2'); var_dump('11e0' == '.11e2'); var_dump('11e0' == '.011e3'); var_dump('1.1e1' == '.11e2'); function print_num() { $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 ruvb6
Output for 4.3.0 - 5.0.0, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
.11e2 = 11 1.1e1 = 11 .011e3 = 11 0.11e2 = 11 bool(true) bool(true) bool(true)
Output for 5.0.1
.11e2 = 0 1.1e1 = 11 .011e3 = 0 0.11e2 = 11 bool(false) bool(false) bool(false)