3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isInteger($a){ return (string)(int)$a === (string)$a; } var_dump(isInteger(10)); var_dump(isInteger(10.01)); var_dump(isInteger("10")); var_dump(isInteger("10.01")); var_dump(isInteger(0x10)); var_dump(isInteger("0x10")); var_dump(isInteger('a')); var_dump(isInteger(null)); var_dump(isInteger(false));
based on c1pjD
Output for 4.3.0 - 7.2.0
bool(true) bool(false) bool(true) bool(false) bool(true) bool(false) bool(false) bool(false) bool(false)