From: Ilia Alshanetsky Date: Tue, 26 Dec 2006 16:45:39 +0000 (+0000) Subject: is_numeric_string() optimization X-Git-Tag: php-5.2.1RC2~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc5be15a6f9cfb2776b50b3f363ffb26668a6a52;p=php is_numeric_string() optimization --- diff --git a/ext/standard/type.c b/ext/standard/type.c index ada33fb091..9f53639680 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -305,7 +305,6 @@ PHP_FUNCTION(is_object) PHP_FUNCTION(is_numeric) { zval **arg; - int result; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { WRONG_PARAM_COUNT; @@ -318,8 +317,7 @@ PHP_FUNCTION(is_numeric) break; case IS_STRING: - result = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), NULL, NULL, 0); - if (result == IS_LONG || result == IS_DOUBLE) { + if (is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), NULL, NULL, 0)) { RETURN_TRUE; } else { RETURN_FALSE;