diff options
| author | Antony Dovgal <tony2001@php.net> | 2005-10-04 20:48:17 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2005-10-04 20:48:17 +0000 |
| commit | 1b8ecbcf54bc9601df9eb6e481901aff9bd303f0 (patch) | |
| tree | 9526b56cadc9abda401dc3ba1d78628829a1530d /ext/standard/array.c | |
| parent | e0e9b5ac393bcd4644b0be211f278f081b643550 (diff) | |
| download | php-git-1b8ecbcf54bc9601df9eb6e481901aff9bd303f0.tar.gz | |
MFH: fix #34723 (array_count_values() strips leading zeroes)
Diffstat (limited to 'ext/standard/array.c')
| -rw-r--r-- | ext/standard/array.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 9c80587850..fd9f2af36f 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2520,8 +2520,9 @@ PHP_FUNCTION(array_count_values) Z_LVAL_PP(tmp)++; } } else if (Z_TYPE_PP(entry) == IS_STRING) { - /* make sure our array does not end up with numeric string keys */ - if (is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) { + /* make sure our array does not end up with numeric string keys + * but don't touch those strings that start with 0 */ + if (!(Z_STRLEN_PP(entry) > 1 && Z_STRVAL_PP(entry)[0] == '0') && is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) { zval tmp_entry; tmp_entry = **entry; |
