mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
- Fixed bug #52534 (var_export array with negative key)
This commit is contained in:
parent
fa27ef4620
commit
3d2a6927c7
14
ext/standard/tests/array/bug52534.phpt
Normal file
14
ext/standard/tests/array/bug52534.phpt
Normal 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',
|
||||
)
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user