derick          Wed Jan  7 14:36:07 2009 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/standard/tests/general_functions       bug47027.phpt 

  Modified files:              
    /php-src/ext/standard       var.c 
  Log:
  - MFH: 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.203.2.7.2.18.2.14&r2=1.203.2.7.2.18.2.15&diff_format=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.203.2.7.2.18.2.14 
php-src/ext/standard/var.c:1.203.2.7.2.18.2.15
--- php-src/ext/standard/var.c:1.203.2.7.2.18.2.14      Wed Dec 31 11:15:46 2008
+++ php-src/ext/standard/var.c  Wed Jan  7 14:36:06 2009
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: var.c,v 1.203.2.7.2.18.2.14 2008/12/31 11:15:46 sebastian Exp $ */
+/* $Id: var.c,v 1.203.2.7.2.18.2.15 2009/01/07 14:36:06 derick Exp $ */
 
 /* {{{ includes
 */
@@ -363,13 +363,15 @@
 
        level = va_arg(args, int);
 
+       php_printf("%*c", level + 1, ' ');
        if (hash_key->nKeyLength != 0) {
-               php_printf("%*c", level + 1, ' ');
                zend_unmangle_property_name(hash_key->arKey, 
hash_key->nKeyLength - 1, &class_name, &prop_name);
                php_printf(" '%s' => ", 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