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(-10, 20) as $n) { echo $n*$n*$n; echo " - "; echo is_intstr($n*$n*$n, true); echo "\n"; }
based on 8Hmur
Output for 4.3.0 - 7.2.0
-1000 - 1 -729 - 1 -512 - 1 -343 - 1 -216 - 1 -125 - 1 -64 - 1 -27 - 1 -8 - 1 -1 - 1 0 - 1 1 - 1 8 - 1 27 - 1 64 - 1 125 - 1 216 - 1 343 - 1 512 - 1 729 - 1 1000 - 1 1331 - 1 1728 - 1 2197 - 1 2744 - 1 3375 - 1 4096 - 1 4913 - 1 5832 - 1 6859 - 1 8000 - 1