Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66442 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82116 invoked from network); 3 Mar 2013 10:26:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Mar 2013 10:26:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.153 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.153 smtp153.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.153] ([67.192.241.153:40585] helo=smtp153.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/91-06331-A5523315 for ; Sun, 03 Mar 2013 05:26:35 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp5.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 7E55319003C; Sun, 3 Mar 2013 05:26:32 -0500 (EST) X-Virus-Scanned: OK Received: by smtp5.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id F4065190035; Sun, 3 Mar 2013 05:26:31 -0500 (EST) Message-ID: <51332556.7000809@sugarcrm.com> Date: Sun, 03 Mar 2013 02:26:30 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: Dmitry Stogov CC: Nikita Popov , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new` From: smalyshev@sugarcrm.com (Stas Malyshev) Hi > > - usage expression in write context (e.g. passing constant by reference) > > function foo(&$foo) {} > foo("abc"[0]); > > - destruction of temporary result > > ($a . $b)[4]; // if ($a.$b) is destroyed? > > - in some cases destruction of temporary result may cause destruction of > final result > > ((object)(array("a"=>"b")))->a = "c"; // temporary object may be destroyed > before assignment I've run a bunch of examples like above, with debug enabled, and so far I could find no scenario where it would leak or access destructed variable. So looks like it works, at least I wasn't able to find any case where it does not :) -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227