- 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 fa27ef4620
commit 3d2a6927c7
2 changed files with 15 additions and 1 deletions

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 */