Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13712 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28619 invoked by uid 1010); 3 Nov 2004 16:38:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 25684 invoked from network); 3 Nov 2004 16:37:39 -0000 Received: from unknown (HELO mx1.moulin.nl) (194.109.193.120) by pb1.pair.com with SMTP; 3 Nov 2004 16:37:39 -0000 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id C50FE8A0FC for ; Wed, 3 Nov 2004 17:37:43 +0100 (CET) Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (moulin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26898-02 for ; Wed, 3 Nov 2004 17:37:40 +0100 (CET) Received: from [10.0.5.5] (ip51cf8e8c.direct-adsl.nl [81.207.142.140]) by mx1.moulin.nl (Postfix) with ESMTP id 300568A0F9 for ; Wed, 3 Nov 2004 17:37:40 +0100 (CET) Message-ID: <4189094F.10105@iamjochem.com> Date: Wed, 03 Nov 2004 17:37:35 +0100 User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-gb, en-us, en, nl MIME-Version: 1.0 Cc: internals@lists.php.net References: <4188DEC8.5060309@gmx.net> <4188DDC9.30000@hristov.com> <4189013F.2050104@gmx.net> <4188F4CC.6000902@hristov.com> <41890B41.5020703@gmx.net> <41890169.1020107@hristov.com> In-Reply-To: <41890169.1020107@hristov.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at moulin.nl Subject: Re: [PHP-DEV] serialize bug with array that references to itself? From: jochem@iamjochem.com (Jochem Maas) Andrey Hristov wrote: > Well, when there is traversion inside the engine, it checks whether it has > processed a "node" already several times. As far as I remember the > threshold > is 3. So once it goes over $Arr, the counter increases to 1, the second > time > to 2 and third time it is 3 and ZE reports recursion. is there good reason to set the threshold at 3 iso 2? when dumping out objects that make heavy use of 'parent' references this leads to tons of extra output which would be greatly cutdown if the threshold was 2 iso 3. just to make the point, print_r seems to use a threshold of 2 (which is why I always try print_r before taking my chances with var_dump): self = $A; var_dump( $A ); print_r( $A ); ?> > > HTH, > Andrey > > Francisco M. Marzoa Alonso wrote: > >> BTW., I'm not sure that there's nothing more wrong here. Takin the >> first part of the code of first example: >> >> > >> $Arr = array(); >> $Arr['self'] = &$Arr; >> var_dump ( $Arr ); >> >> ?> >> >> It returns: >> >> array(1) { >> ["self"]=> >> array(1) { >> ["self"]=> >> *RECURSION* >> } >> } >> >> Is that as its expected to be? I meant that perhaps it should be: >> >> array(1) { >> ["self"]=> >> *RECURSION* >> } >> >> Since the element in $Arr['self'] is yet (or at least should be) a >> reference to itself... >> >