Whether the data is a string ("0") or integer (0), is_numeric() will return true. (And for that matter the data will always be string if it's user input. And integer data will be cast to string within the function.) Your first function should work, and in fact does. Your second function "works", too, in that it returns false from the first return statement as it should, with both "0" and 0 passed to it.
From the manual:
is_numeric -- Finds whether a variable is a number or a numeric string
An integer is treated the same way because of automatic casting.
$x = 0;
if ($x == '0') {
echo 'string'; // echoed
} else {
echo 'integer';
}
if ($x === '0') {
echo 'string';
} else {
echo 'integer'; // echoed
}