Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:290 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8890 invoked from network); 26 Mar 2003 01:53:10 -0000 Received: from unknown (HELO bimba.bezeqint.net) (192.115.106.39) by pb1.pair.com with SMTP; 26 Mar 2003 01:53:10 -0000 Received: from mr4.bezeqint.net (pip-18.bezeqint.net [192.115.106.18]) by bimba.bezeqint.net (Bezeq International SMTP out Mail Server) with ESMTP id 37CBB7DA for ; Wed, 26 Mar 2003 03:49:29 +0200 (IST) Received: from mail.zend.com (bzq-117-235-230.cust.bezeqint.net [192.117.235.230]) by mr4.bezeqint.net (Mirapoint Messaging Server MOS 3.3.3-GR) with SMTP id ARX80970; Wed, 26 Mar 2003 03:53:02 +0200 (IST) Received: (qmail 12530 invoked from network); 26 Mar 2003 01:52:52 -0000 Received: from localhost (HELO zeev-laptop.zend.com) (127.0.0.1) by localhost with SMTP; 26 Mar 2003 01:52:52 -0000 Reply-To: zeev@zend.com Message-ID: <5.1.0.14.2.20030325175134.05844f18@localhost> X-Sender: zeev@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 25 Mar 2003 17:52:32 -0800 To: Jan Schneider Cc: internals@lists.php.net In-Reply-To: <1048601587.22f84c63a1eac@jan.dip.ammma.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] ZE2 race condition From: zeev@zend.com (Zeev Suraski) References: <1048601587.22f84c63a1eac@jan.dip.ammma.net> That's quite intentional - assignments in ZE2 are handle based, versus the value based in ZE1. That's more or less the biggest change in ZE2 :) If you want to create copies like in ZE1 you can use __clone(). Zeev At 06:13 25/03/2003, Jan Schneider wrote: >Running the following code: > >class Foo { > var $bar_ref; >} > >class Bar { > var $foo_ref; >} > >$foo = new Foo(); >$bar = new Bar(); >$foo->bar_ref = $bar; >$bar->foo_ref = $foo; > >var_dump($foo); >var_dump($bar); > >$s = serialize($foo); >var_dump($s); >$s = serialize($bar); >var_dump($s); > > >in PHP_4_3 results to: > >object(foo)(1) { > ["bar_ref"]=> > object(bar)(1) { > ["foo_ref"]=> > NULL > } >} >object(bar)(1) { > ["foo_ref"]=> > object(foo)(1) { > ["bar_ref"]=> > object(bar)(1) { > ["foo_ref"]=> > NULL > } > } >} >string(58) "O:3:"foo":1:{s:7:"bar_ref";O:3:"bar":1:{s:7:"foo_ref";N;}}" >string(86) >"O:3:"bar":1:{s:7:"foo_ref";O:3:"foo":1:{s:7:"bar_ref";O:3:"bar":1:{s:7:"foo_ref";N;}}}" > > >in HEAD: > >object(foo)#1 (1) { > ["bar_ref"]=> > object(bar)#2 (1) { > ["foo_ref"]=> > object(foo)#1 (1) { > ["bar_ref"]=> > object(bar)#2 (1) { > ["foo_ref"]=> > *RECURSION* > } > } > } >} >object(bar)#2 (1) { > ["foo_ref"]=> > object(foo)#1 (1) { > ["bar_ref"]=> > object(bar)#2 (1) { > ["foo_ref"]=> > object(foo)#1 (1) { > ["bar_ref"]=> > *RECURSION* > } > } > } >} > >and a segfault (apache 1 sapi) or a runaway process (cli sapi). > >Jan. > >-- >http://www.horde.org - The Horde Project >http://www.ammma.de - discover your knowledge >http://www.tip4all.de - Deine private Tippgemeinschaft > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php