derick Fri Oct 11 09:49:20 2002 EDT
Added files:
/php4/ext/standard/tests/array var_export.phpt
Modified files:
/php4/ext/standard var.c
Log:
- Fix problem with var_export when objects with numeric indexes were
exported. We now skip those, as there is no way to export valid code for
it.
Index: php4/ext/standard/var.c
diff -u php4/ext/standard/var.c:1.149 php4/ext/standard/var.c:1.150
--- php4/ext/standard/var.c:1.149 Sun Oct 6 08:02:52 2002
+++ php4/ext/standard/var.c Fri Oct 11 09:49:20 2002
@@ -272,9 +272,9 @@
if (hash_key->nKeyLength != 0) {
php_printf("%*cvar $%s = ", level + 1, ' ', hash_key->arKey);
+ php_var_export(zv, level + 2 TSRMLS_CC);
+ PUTS (";\n");
}
- php_var_export(zv, level + 2 TSRMLS_CC);
- PUTS (";\n");
return 0;
}
Index: php4/ext/standard/tests/array/var_export.phpt
+++ php4/ext/standard/tests/array/var_export.phpt
--TEST--
var_export() and objects with numeric indexes properties
--POST--
--GET--
--INI--
--FILE--
<?php
$a = (object) array (1, 3, "foo" => "bar");
var_export($a);
?>
--EXPECT--
class stdClass {
var $foo = 'bar';
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php