Skip to content

Instantly share code, notes, and snippets.

@matusmarcin
Created November 30, 2015 14:48
Show Gist options
  • Save matusmarcin/fc9dff0ed50b1344d0ee to your computer and use it in GitHub Desktop.
Save matusmarcin/fc9dff0ed50b1344d0ee to your computer and use it in GitHub Desktop.
My PHP improvement functions - very useful!
// Proper is_integer() check for dynamically typed PHP
// Yes, partly a joke.
function is_or_can_be_integer($value) {
return is_integer($value) || strcmp((string)(int)$value, $value) === 0;
}
// TODO
// Fix or wrap strpos() to return boolean.
// Fix all functions that use haystack needle or needle haystack params always in a different order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment