Table of contents Home page
$x = 9; if (is_int($x)) { echo "\$x ($x) contains a PHP integer.\n"; } else { echo "\$x ($x) does not contain a PHP integer.\n"; // Never executed } $x = 9.0; if (is_int($x)) { echo "\$x ($x) contains a PHP integer.\n"; // Never executed } else { echo "\$x ($x) does not contain a PHP integer.\n"; } $x = PHP_INT_MAX + 1; // Not an integer according to the PHP definition (it's whole, but outside the range) if (is_int($x)) { echo "\$x ($x) contains a PHP integer.\n"; // Never executed } else { echo "\$x ($x) does not contain a PHP integer.\n"; }