Index: ext/standard/array.c =================================================================== RCS file: /repository/php-src/ext/standard/array.c,v retrieving revision 1.308.2.5 diff -u -p -d -r1.308.2.5 array.c --- ext/standard/array.c 3 Oct 2005 14:04:16 -0000 1.308.2.5 +++ ext/standard/array.c 4 Oct 2005 18:20:49 -0000 @@ -2507,6 +2507,8 @@ PHP_FUNCTION(array_count_values) myht = Z_ARRVAL_PP(input); zend_hash_internal_pointer_reset_ex(myht, &pos); while (zend_hash_get_current_data_ex(myht, (void **)&entry, &pos) == SUCCESS) { + zend_bool zero_prefixed = 0; + if (Z_TYPE_PP(entry) == IS_LONG) { if (zend_hash_index_find(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), @@ -2520,8 +2522,11 @@ PHP_FUNCTION(array_count_values) Z_LVAL_PP(tmp)++; } } else if (Z_TYPE_PP(entry) == IS_STRING) { + if (Z_STRLEN_PP(entry) > 1 && Z_STRVAL_PP(entry)[0] == '0') { + zero_prefixed = 1; + } /* 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) { + if (!zero_prefixed && is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) { zval tmp_entry; tmp_entry = **entry;