3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array( "42", 1337, 0x539, 02471, 0b10100111001, 1337e0, "not numeric", array(), 9.1 ); foreach ($tests as $element) { if (is_numeric($element)) { echo "'{$element}' is considered numeric", PHP_EOL; } else { echo "'{$element}' is not considered numeric", PHP_EOL; } }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
'42' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric 'not numeric' is not considered numeric Warning: Array to string conversion in /in/aWHAf on line 19 'Array' is not considered numeric '9.1' is considered numeric
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
'42' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric 'not numeric' is not considered numeric Notice: Array to string conversion in /in/aWHAf on line 19 'Array' is not considered numeric '9.1' is considered numeric
Output for 7.3.32 - 7.3.33
'42' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric '1337' is considered numeric 'not numeric' is not considered numeric 'Array' is not considered numeric '9.1' is considered numeric

preferences:
208.56 ms | 402 KiB | 330 Q