diff options
author | Zeev Suraski <zeev@php.net> | 2003-07-22 16:06:07 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2003-07-22 16:06:07 +0000 |
commit | cf90932a05b03354fdf6b844ff3a6902fc51a928 (patch) | |
tree | 4979bfe564435a2f5ac19e4c839ea58e8d11beed /Zend/zend_operators.c | |
parent | 5fcff2d872dfc59328e8855b5bc754a1efe48005 (diff) | |
download | php-git-cf90932a05b03354fdf6b844ff3a6902fc51a928.tar.gz |
Improve infrastructure of numeric handling of elements in symbol tables.
When you want to work with a symbol table, and you don't know whether you
have a numeric ("string that looks like a number") or a string element in
your hands, use zend_symtable_*() functions, in place of zend_hash_*()
functions.
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r-- | Zend/zend_operators.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index ed63fa47c1..9f7bf6209b 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -33,41 +33,6 @@ #include "ext/bcmath/number.h" #endif -ZEND_API zend_bool zend_is_numeric_key(zval *zvalue, long *val) -{ - char *tmp; - long length; - - tmp = zvalue->value.str.val; - length = zvalue->value.str.len; - - if ((*tmp>='0' && *tmp<='9')) { /* possibly a numeric index */ - char *end=tmp+length; - ulong idx; - - if (*tmp++=='0' && length>2) { /* don't accept numbers with leading zeros */ - return 0; - } - - while (tmp<end) { - if (!(*tmp>='0' && *tmp<='9')) { - break; - } - tmp++; - } - - if (tmp==end && *tmp=='\0') { /* a numeric index */ - idx = strtol(zvalue->value.str.val, NULL, 10); - if (idx!=LONG_MAX) { - *val = idx; - return 1; - } - } - } - - return 0; -} - ZEND_API int zend_atoi(const char *str, int str_len) { int retval; |