3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function array_is_numerical($unsafeArray) { foreach($unsafeArray as $entry) { if (!is_numeric($entry)) { return false; } } return true; } $testArray = array(1,2,3,4,5); $testArray2 = array(1,2,3,'vier',5); $testNumber = 1; echo '(' . join(', ', $testArray) . ')'; echo '<br>'; echo(array_is_numerical($testArray)); echo '<br>'; echo(array_is_numerical($testArray2));
based on kIhDJ
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0rc3
(1, 2, 3, 4, 5)<br>1<br>