Isn't `$value == ((int)$value)` similar to `is_numeric( $value ) || $value === ""`?
Is an empty string supposed to be treated as `0`?