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) { print_r(is_intstr($n)); }
based on cUab6
Output for 4.3.11 - 7.2.0
Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: preg_match(): No ending delimiter '/' found in /in/CjHO6 on line 4
Output for 4.3.0 - 4.3.10
Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4 Warning: No ending delimiter '/' found in /in/CjHO6 on line 4