]> granicus.if.org Git - php/commitdiff
Fix bug #7599
authorZeev Suraski <zeev@php.net>
Thu, 2 Nov 2000 23:17:55 +0000 (23:17 +0000)
committerZeev Suraski <zeev@php.net>
Thu, 2 Nov 2000 23:17:55 +0000 (23:17 +0000)
Zend/zend.c

index 710cf2b2f452337c8b3e21e1eacf25322b896644..45f351436b042c2f7f7bc5a4c3cc647ab1af4a3f 100644 (file)
@@ -198,11 +198,23 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
        switch(expr->type) {
                case IS_ARRAY:
                        ZEND_PUTS("Array\n");
+                       if (++expr->value.ht->nApplyCount>1) {
+                               ZEND_PUTS(" *RECURSION*");
+                               expr->value.ht->nApplyCount=0;
+                               return;
+                       }
                        print_hash(expr->value.ht,indent);
+                       expr->value.ht->nApplyCount--;
                        break;
                case IS_OBJECT:
+                       if (++expr->value.obj.properties->nApplyCount>1) {
+                               ZEND_PUTS(" *RECURSION*");
+                               expr->value.obj.properties->nApplyCount=0;
+                               return;
+                       }
                        zend_printf("%s Object\n", expr->value.obj.ce->name);
                        print_hash(expr->value.obj.properties, indent);
+                       expr->value.obj.properties->nApplyCount--;
                        break;
                default:
                        zend_print_variable(expr);