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, 100) as $n) { echo $n*$n; echo " - "; echo is_intstr($n*$n); echo "\n"; }
based on th8dN
Output for 4.3.0 - 7.2.0
0 - 1 1 - 1 4 - 1 9 - 1 16 - 1 25 - 1 36 - 1 49 - 1 64 - 1 81 - 1 100 - 1 121 - 1 144 - 1 169 - 1 196 - 1 225 - 1 256 - 1 289 - 1 324 - 1 361 - 1 400 - 1 441 - 1 484 - 1 529 - 1 576 - 1 625 - 1 676 - 1 729 - 1 784 - 1 841 - 1 900 - 1 961 - 1 1024 - 1 1089 - 1 1156 - 1 1225 - 1 1296 - 1 1369 - 1 1444 - 1 1521 - 1 1600 - 1 1681 - 1 1764 - 1 1849 - 1 1936 - 1 2025 - 1 2116 - 1 2209 - 1 2304 - 1 2401 - 1 2500 - 1 2601 - 1 2704 - 1 2809 - 1 2916 - 1 3025 - 1 3136 - 1 3249 - 1 3364 - 1 3481 - 1 3600 - 1 3721 - 1 3844 - 1 3969 - 1 4096 - 1 4225 - 1 4356 - 1 4489 - 1 4624 - 1 4761 - 1 4900 - 1 5041 - 1 5184 - 1 5329 - 1 5476 - 1 5625 - 1 5776 - 1 5929 - 1 6084 - 1 6241 - 1 6400 - 1 6561 - 1 6724 - 1 6889 - 1 7056 - 1 7225 - 1 7396 - 1 7569 - 1 7744 - 1 7921 - 1 8100 - 1 8281 - 1 8464 - 1 8649 - 1 8836 - 1 9025 - 1 9216 - 1 9409 - 1 9604 - 1 9801 - 1 10000 - 1