3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tests = array( "42", 1337, "1e4", "not numeric", 9.1, '234ffffdsf' ); foreach ($tests as $element) { if (is_numeric($element)) { echo "'{$element}' - число", PHP_EOL; } else { echo "'{$element}' - НЕ число", PHP_EOL; } }
based on Qrs3n
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
'42' - число '1337' - число '1e4' - число 'not numeric' - НЕ число '9.1' - число '234ffffdsf' - НЕ число
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
'42' - число Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3h6FL on line 14 PHP_EOL'1337' - число Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3h6FL on line 14 PHP_EOL'1e4' - число Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3h6FL on line 14 PHP_EOL'not numeric' - НЕ число Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3h6FL on line 16 PHP_EOL'9.1' - число Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3h6FL on line 14 PHP_EOL'234ffffdsf' - НЕ число Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3h6FL on line 16 PHP_EOL