3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isInteger($a){ return (string)(int)$a === (string)$a; } var_dump(isInteger(1)); var_dump(isInteger('1')); var_dump(isInteger('a')); var_dump(isInteger('1a')); var_dump(isInteger('11111'));
Output for 4.3.0 - 7.2.0
bool(true) bool(true) bool(false) bool(false) bool(true)