]> granicus.if.org Git - php/commitdiff
- MF43: Fixed bug #31072 (var_export() does not output an array element with an
authorDerick Rethans <derick@php.net>
Fri, 17 Dec 2004 14:40:39 +0000 (14:40 +0000)
committerDerick Rethans <derick@php.net>
Fri, 17 Dec 2004 14:40:39 +0000 (14:40 +0000)
  empty string key). (Derick)

ext/standard/tests/array/var_export2.phpt [new file with mode: 0644]
ext/standard/var.c

diff --git a/ext/standard/tests/array/var_export2.phpt b/ext/standard/tests/array/var_export2.phpt
new file mode 100644 (file)
index 0000000..2b8a1f9
Binary files /dev/null and b/ext/standard/tests/array/var_export2.phpt differ
index be164c151dd444e71da067ac43c3b4db6a986803..c07696aabe6a89c4ff43c290fc5d2e2c3661ac6c 100644 (file)
@@ -319,20 +319,13 @@ static int php_array_element_export(zval **zv, int num_args, va_list args, zend_
        if (hash_key->nKeyLength==0) { /* numeric key */
                php_printf("%*c%ld => ", level + 1, ' ', hash_key->h);
        } else { /* string key */
-               /* XXX: perphaps when we are inside the class we should permit access to 
-                * private & protected values
-                */
-               if (va_arg(args, int) && hash_key->arKey[0] == '\0') {
-                       return 0;
-               } else {
-                       char *key;
-                       int key_len;
-                       key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC);
-                       php_printf("%*c'", level + 1, ' ');
-                       PHPWRITE(key, key_len);
-                       php_printf("' => ");
-                       efree(key);
-               }
+               char *key;
+               int key_len;
+               key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC);
+               php_printf("%*c'", level + 1, ' ');
+               PHPWRITE(key, key_len);
+               php_printf("' => ");
+               efree(key);
        }
        php_var_export(zv, level + 2 TSRMLS_CC);
        PUTS (",\n");