3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function is_intstr($val) { return preg_match("/^(0|[1-9][0-9]*)$/", $val); } foreach(range(0, 10) as $n) { echo $n; echo " - "; echo is_intstr("$n"); echo "\n"; }
based on qvQld
Output for 4.3.0 - 7.2.0
0 - 1 1 - 1 2 - 1 3 - 1 4 - 1 5 - 1 6 - 1 7 - 1 8 - 1 9 - 1 10 - 1