3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function check_int($i) { if (preg_match('[^0-9]', $i)) { return 0; } else { return 1; } } function check_int1($i) { return (strval((int)$i) === strval($i)); } echo check_int(-10) ? "It's an int\n" : "It's not an int\n"; echo check_int(-10) ? "It's an int\n" : "It's not an int\n";
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
It's an int It's an int