3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tests = array( '0x539', '02471', '1337e0', '0b10100111001', ); foreach ($tests as $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
'0x539' is NOT numeric '02471' is numeric '1337e0' is numeric '0b10100111001' is NOT numeric
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0
'0x539' is numeric '02471' is numeric '1337e0' is numeric '0b10100111001' is NOT numeric
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
'0x539' is numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vpHrs on line 12 PHP_EOL'02471' is numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vpHrs on line 12 PHP_EOL'1337e0' is numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vpHrs on line 12 PHP_EOL'0b10100111001' is NOT numeric Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vpHrs on line 14 PHP_EOL