Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78154 invoked from network); 18 Apr 2008 18:42:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2008 18:42:42 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:55252] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/7D-10014-B9BE8084 for ; Fri, 18 Apr 2008 14:42:42 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 18 Apr 2008 21:43:19 +0300 Received: from [192.168.16.217] ([192.168.16.217]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 18 Apr 2008 11:43:15 -0700 Message-ID: <4808EB94.3060509@zend.com> Date: Fri, 18 Apr 2008 11:42:28 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Sam Barrow CC: internals@lists.php.net References: <1208535802.22418.1.camel@sbarrow-desktop> In-Reply-To: <1208535802.22418.1.camel@sbarrow-desktop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 Apr 2008 18:43:15.0561 (UTC) FILETIME=[0FF63D90:01C8A184] Subject: Re: [PHP-DEV] Object instantiation From: stas@zend.com (Stanislav Malyshev) Hi! > $result = new myObject -> myMethod(); > > Is there a technical reason as to why this can't be done? If not can > this be changed? I think this can not be parsed unambiguously. This could be new (expression with ->) or (new expression)->expression. E.g., what this means: $a = new $foo->bar(); is it a new object whose name given by $foo and then bar() called on it, or is it a new object whose name given by variable $foo->bar with empty ctor? Also, I'm not sure it's a good style - if you are creating object just to drop it immediately in the same expression, maybe it should be static method that creates the object internally? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com