Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17346 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98313 invoked by uid 1010); 20 Jul 2005 15:22:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 98281 invoked from network); 20 Jul 2005 15:22:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2005 15:22:35 -0000 X-Host-Fingerprint: 81.19.68.198 netlogic-ramtel.cust.ramtel.ru Received: from ([81.19.68.198:10738] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6227M)) with SMTP id B7/51-61486-CF56ED24 for ; Wed, 20 Jul 2005 10:55:56 -0400 Message-ID: To: internals@lists.php.net Date: Wed, 20 Jul 2005 18:56:37 +0400 User-Agent: Mozilla Thunderbird 1.0 (X11/20050312) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <1121626339.23752.24.camel@blobule.suds> In-Reply-To: X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 81.19.68.198 Subject: Re: [PHP-DEV] Re: Reference Notice From: na@index20.ru (Andrey Nikolaev) Derick Rethans wrote: > On Wed, 20 Jul 2005, Andrey Nikolaev wrote: > > >>function &a() { >> if(1==2) >> return new B; //some reference... >> else >> return null; //error, we cant create B >>} >>$b_instance = a(); >>?> > > > Why are you returning by reference in the first place here? "new B" > already creates a copy. > > Derick > That's not a point, i'm telling about "return null". However "return & new B" is also not allowed...