3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tests = array( '0x539', '02471', '1337e0', '0b10100111001', ); foreach ($tests as $element) { var_dump((int)$element); if (is_numeric($element)) { echo "'{$element}' is numeric", PHP_EOL; } else { echo "'{$element}' is NOT numeric", PHP_EOL; } }
Output for 7.0.0 - 7.1.0
int(0) '0x539' is NOT numeric int(2471) '02471' is numeric int(1337) '1337e0' is numeric int(0) '0b10100111001' is NOT numeric
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.12.0
int(0) '0x539' is numeric int(2471) '02471' is numeric int(1337) '1337e0' is numeric int(0) '0b10100111001' is NOT numeric
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
int(0) '0x539' is numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9QLjT on line 13 PHP_EOLint(2471) '02471' is numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9QLjT on line 13 PHP_EOLint(1337) '1337e0' is numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9QLjT on line 13 PHP_EOLint(0) '0b10100111001' is NOT numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9QLjT on line 15 PHP_EOL