3v4l.org

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