- Fixed bug #52534 (var_export array with negative key)

This commit is contained in:
Felipe Pena 2010-08-04 23:11:44 +00:00
parent 5fe988518a
commit 1e17bb2aab
3 changed files with 16 additions and 1 deletions

1
NEWS
View File

@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2010, PHP 5.3.4
- Fixed bug #52534 (var_export array with negative key). (Felipe)
- Fixed bug #52508 (newline problem with parse_ini_file+INI_SCANNER_RAW).
(Felipe)
- Fixed bug #52487 (PDO::FETCH_INTO leaks memory). (Felipe)

View File

@ -0,0 +1,14 @@
--TEST--
Bug #52534 (var_export array with negative key)
--FILE--
<?php
$aArray = array ( -1 => 'Hello');
var_export($aArray);
?>
--EXPECT--
array (
-1 => 'Hello',
)

View File

@ -353,7 +353,7 @@ static int php_array_element_export(zval **zv TSRMLS_DC, int num_args, va_list a
if (hash_key->nKeyLength == 0) { /* numeric key */
buffer_append_spaces(buf, level+1);
smart_str_append_long(buf, hash_key->h);
smart_str_append_long(buf, (long) hash_key->h);
smart_str_appendl(buf, " => ", 4);
} else { /* string key */
char *key, *tmp_str;