diff options
author | Anatol Belski <ab@php.net> | 2014-10-03 20:30:49 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-10-03 20:30:49 +0200 |
commit | ee4ae7fbc3ba6de5f51f95a621e14a18dd55c95d (patch) | |
tree | d774f5b506e70bc8a70ef22988e2d374bf0756b8 /Zend/zend_operators.h | |
parent | 45e23645a42ba939fb1cca9cc099f977af2a4722 (diff) | |
parent | 1ff094deb481234c0aa2fb5b0ee144b7aba924ff (diff) | |
download | php-git-ee4ae7fbc3ba6de5f51f95a621e14a18dd55c95d.tar.gz |
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
remove the remains of dsp files handling
fix EX usage
remove misprint parentheses
remove misprint parentheses
Replaced EG(This) and EX(object) with EX(This). Internal functions now recieves zend_execute_data as the first argument.
And this one...
It should be in extern c
Remove useless condition
NEWS entry for previous commit
NEWS entry for previous commit
add IPv6 support to php-fpm
Micro optimization for the most frequency case
Add hash to EXTENSIONS file
Remove extensions which are long gone
we also have xz release tarballs since 5.5
Fix ZTS build
improved file size computation in stat()
Fixed incorrect compilation
5.5.19 now
Diffstat (limited to 'Zend/zend_operators.h')
-rw-r--r-- | Zend/zend_operators.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 39a7e1f541..8075edf939 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -69,6 +69,24 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSR ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC); ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce TSRMLS_DC); + +/** + * 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. + */ +ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info); + END_EXTERN_C() #if ZEND_DVAL_TO_LVAL_CAST_OK @@ -125,23 +143,6 @@ static zend_always_inline zend_long zend_dval_to_lval(double d) #define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9') #define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f')) -/** - * 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. - */ -ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info); - static zend_always_inline zend_uchar is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, int allow_errors, int *oflow_info) { if (*str > '9') { |