Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19539 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59758 invoked by uid 1010); 9 Oct 2005 14:36:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59743 invoked from network); 9 Oct 2005 14:36:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2005 14:36:10 -0000 X-Host-Fingerprint: 195.227.108.51 wfserver02.wf-ppr.de Windows 2000 SP2+, XP SP1 (seldom 98 4.10.2222) Received: from ([195.227.108.51:30586] helo=wfserver02.wf-ppr.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 9B/34-54476-6DA29434 for ; Sun, 09 Oct 2005 10:36:08 -0400 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Date: Sun, 9 Oct 2005 16:36:00 +0200 Message-ID: <00A2E2156BEE8446A81C8881AE117F192C15D8@companyweb> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] return /* by reference */ new Foo() in PHP4 Thread-Index: AcXM1UXGPPfEtp6vQ6eJji5EIemSAwAAg0dQAAG+Z7A= To: Subject: AW: [PHP-DEV] return /* by reference */ new Foo() in PHP4 From: mp@webfactory.de ("Matthias Pigulla") Hm, thinking a little more about this one: > > function &getstuff($in) > > { > > if ($in=3D=3D'ok') > > return new MyObject(); > > else > > return false; // this is the common line > > } "return false" (or null) is trying to return a reference to a literal, which is (of course) questionable. "new fooclass()" is *not* a literal but something that *can* and *should* be referenced: see http://www.php.net/manual/en/language.references.whatdo.php. So at least "return /* byref*/ new ..." should be something that works without a notice. Matthias