检查变量值是否为base10整数的最简单和/或最有效的方法是什么?

I've been trying to think of a function that could be used to check a variable value if it is an integer in base10, regardless of is it type of integer or string. It would be used mostly for checking POST values, primarily produced by AJAX (which can be easily modified by user).

Googling does not produce relative results (for me), or I don't know the "correct" phrases to search with.

Problem with current built-ins is, that they all require extra-checking, as they "leak" somehow, when only allowed is base10 integers. For example, filter_var with FILTER_VALIDATE_INT passes "123 " (notice space at the end).

I've myself come up with two functions, which I'm also asking your opinion for, what you think of them. Are they as reliable as I think they are? Which one of them I should use, or do you know something better?

function myIsInt1($value)
{
    if(is_int($value))return true;
    if(is_float($value))return ($value===(float)(int)$value);
    if(!is_string($value))return false;
    return ($value===(string)(int)$value);
}

and

function myIsInt2($value)
{
    /* this wont work as supposed to, because it allows overflowing integers */
    if(is_int($value))return true;
    if(is_float($value))return ($value===(float)(int)$value);
    if(!is_string($value))return false;
    return !!preg_match('/^(0|\-?[1-9][0-9]*)$/',$value);
}

is_string() check is required in both, as otherwise first function gives false positives, and second produces warnings. Function's purpose is to validate, possible type-juggling is done elsewhere.

Some test-results:

$values = array(
    '-0',
    -0,
    0,
    123,
    -123,
    '123',
    '-123',
    '0123',
    '123 ',
    '0',
    '000',
    '+123',
    '1.23',
    1.23,
    '123e4',
    '0x123',
    'potato',
    'EEBD',
    true,
    false,
    null,
    '10000000000000000000',
    10000000000000000000
);

PHP version: 5.4.30
string(2) "-0" = bool(false) bool(false)
int(0) = bool(true) bool(true)
int(0) = bool(true) bool(true)
int(123) = bool(true) bool(true)
int(-123) = bool(true) bool(true)
string(3) "123" = bool(true) bool(true)
string(4) "-123" = bool(true) bool(true)
string(4) "0123" = bool(false) bool(false)
string(4) "123 " = bool(false) bool(false)
string(1) "0" = bool(true) bool(true)
string(3) "000" = bool(false) bool(false)
string(4) "+123" = bool(false) bool(false)
string(4) "1.23" = bool(false) bool(false)
float(1.23) = bool(false) bool(false)
float(2) = bool(true) bool(true)
string(5) "123e4" = bool(false) bool(false)
string(5) "0x123" = bool(false) bool(false)
string(6) "potato" = bool(false) bool(false)
string(4) "EEBD" = bool(false) bool(false)
bool(true) = bool(false) bool(false)
bool(false) = bool(false) bool(false)
NULL = bool(false) bool(false)
string(20) "10000000000000000000" = bool(false) bool(true)
float(1.0E+19) = bool(false) bool(false) 

(Source for var-list (nearly as is) and idea for the regex: http://wisercoder.com/check-for-integer-in-php/)

[EDIT] preg_match-based function wont work, because it either allows overflowing integers (current) or has to disallow possible integers.