derick          Wed Jan  7 14:35:50 2009 UTC

  Added files:                 
    /php-src/ext/standard/tests/general_functions       bug47027.phpt 

  Modified files:              
    /php-src/ext/standard       var.c 
  Log:
  - Fixed bug #47027 (var_export doesn't show numeric indices on ArrayObject).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.279&r2=1.280&diff_format=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.279 php-src/ext/standard/var.c:1.280
--- php-src/ext/standard/var.c:1.279    Wed Dec 31 11:12:37 2008
+++ php-src/ext/standard/var.c  Wed Jan  7 14:35:50 2009
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: var.c,v 1.279 2008/12/31 11:12:37 sebastian Exp $ */
+/* $Id: var.c,v 1.280 2009/01/07 14:35:50 derick Exp $ */
 
 /* {{{ includes
 */
@@ -486,13 +486,15 @@
 
        level = va_arg(args, int);
 
+       php_printf("%*c", level + 1, ' ');
        if (hash_key->nKeyLength != 0) {
-               php_printf("%*c", level + 1, ' ');
                zend_u_unmangle_property_name(hash_key->type, hash_key->arKey, 
hash_key->nKeyLength - 1, &class_name, &prop_name);
                php_printf(" '%R' => ", hash_key->type, prop_name);
-               php_var_export(zv, level + 2 TSRMLS_CC);
-               PUTS (",\n");
+       } else {
+               php_printf(" %ld => ", hash_key->h);
        }
+       php_var_export(zv, level + 2 TSRMLS_CC);
+       PUTS (",\n");
        return 0;
 }
 /* }}} */

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug47027.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/bug47027.phpt
+++ php-src/ext/standard/tests/general_functions/bug47027.phpt
--TEST--
Bug #47027 (var_export doesn't show numeric indices on ArrayObject)
--FILE--
<?php
$ao = new ArrayObject(array (2 => "foo", "bar" => "baz"));
var_export ($ao);
?>
--EXPECT--
ArrayObject::__set_state(array(
   2 => 'foo',
   'bar' => 'baz',
))



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to