3v4l.org

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