Skip to content

Instantly share code, notes, and snippets.

@jk
Created July 18, 2011 12:56
Show Gist options
  • Save jk/1089434 to your computer and use it in GitHub Desktop.
Save jk/1089434 to your computer and use it in GitHub Desktop.
Go straight to hell with the PHP type system
<?php
function isReallyAnInt($obj)
{
if (!is_numeric($obj))
return false;
if (intval($obj) != floatval($obj))
return false;
return true;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment