helly Sun Aug 14 17:26:02 2005 EDT
Modified files:
/php-src/ext/standard var.c
Log:
- Simplify and make work in all modes
http://cvs.php.net/diff.php/php-src/ext/standard/var.c?r1=1.207&r2=1.208&ty=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.207 php-src/ext/standard/var.c:1.208
--- php-src/ext/standard/var.c:1.207 Sun Aug 14 11:18:46 2005
+++ php-src/ext/standard/var.c Sun Aug 14 17:26:01 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.207 2005/08/14 15:18:46 helly Exp $ */
+/* $Id: var.c,v 1.208 2005/08/14 21:26:01 helly Exp $ */
@@ -149,32 +149,19 @@
if (hash_key->nKeyLength ==0 ) { /* numeric key */
php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h);
} else { /* string key */
+ int is_unicode = hash_key->type == IS_UNICODE;
+
zend_u_unmangle_property_name(hash_key->type,
hash_key->u.string, &class_name, &prop_name);
php_printf("%*c[", level + 1, ' ');
if (class_name) {
- if (hash_key->type == IS_STRING) {
- php_printf("\"");
- PHPWRITE(prop_name, strlen(prop_name));
- } else if (hash_key->type == IS_UNICODE) {
- php_printf("u");
- php_var_dump_unicode((UChar*)prop_name,
u_strlen((UChar*)prop_name), verbose TSRMLS_CC);
- }
if (class_name[0]=='*') {
- ZEND_PUTS(":protected");
+ php_printf("%s\"%R\":protected", is_unicode ?
"u" : "", hash_key->type, prop_name);
} else {
- php_printf(":u");
- php_var_dump_unicode((UChar*)class_name,
u_strlen((UChar*)class_name), verbose TSRMLS_CC);
- ZEND_PUTS(":private");
+ php_printf("%s\"%R\":%s\"%R\":private",
is_unicode ? "u" : "", hash_key->type, prop_name, is_unicode ? "u" : "",
hash_key->type, class_name);
}
} else {
- if (hash_key->type == IS_STRING) {
- php_printf("\"");
- PHPWRITE(hash_key->u.string,
hash_key->nKeyLength - 1);
- } else if (hash_key->type == IS_UNICODE) {
- php_printf("u");
- php_var_dump_unicode(hash_key->u.unicode,
hash_key->nKeyLength-1, verbose TSRMLS_CC);
- }
+ php_printf("%s\"%R\"", is_unicode ? "u" : "",
hash_key->type, prop_name);
}
ZEND_PUTS("]=>\n");
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php