pub unsafe extern "C" fn _is_numeric_string_ex(
    str_: *const c_char,
    length: usize,
    lval: *mut zend_long,
    dval: *mut f64,
    allow_errors: bool,
    oflow_info: *mut c_int,
    trailing_data: *mut bool
) -> zend_uchar
Expand description

Checks whether the string “str” with length “length” is numeric. The value of allow_errors determines whether it’s required to be entirely numeric, or just its prefix. Leading whitespace is allowed.

The function returns 0 if the string did not contain a valid number; IS_LONG if it contained a number that fits within the range of a long; or IS_DOUBLE if the number was out of long range or contained a decimal point/exponent. The number’s value is returned into the respective pointer, *lval or *dval, if that pointer is not NULL.

This variant also gives information if a string that represents an integer could not be represented as such due to overflow. It writes 1 to oflow_info if the integer is larger than ZEND_LONG_MAX and -1 if it’s smaller than ZEND_LONG_MIN.