Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19560 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56958 invoked by uid 1010); 10 Oct 2005 19:24:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56943 invoked from network); 10 Oct 2005 19:24:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2005 19:24:24 -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:40353] helo=wfserver02.wf-ppr.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 84/1A-54476-7EFBA434 for ; Mon, 10 Oct 2005 15:24:23 -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: Mon, 10 Oct 2005 21:24:13 +0200 Message-ID: <00A2E2156BEE8446A81C8881AE117F192C1611@companyweb> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] return /* by reference */ new Foo() in PHP4 Thread-Index: AcXNv2vvnYB3MNvXS6qfPrXyqvxF0wADZPVg To: Subject: AW: [PHP-DEV] return /* by reference */ new Foo() in PHP4 From: mp@webfactory.de ("Matthias Pigulla") > I agree that allowing "=3D& new" and disallowing "return new"=20 > by reference is inconsistent. I'm so stubborn with this one because there might be good reasons if you're the mechanic lying under the car fixing the engine, but it does not make any sense if you just want to drive the car :) > But PHP4 is stable tree. We don't like different versions=20 > with different behavior. I don't get that point :( If you make changes like the one from 4.3.12 to 4.4.0, why don't take back the notice with 4.4.1 if it makes no sense? Why's that "different behavior"? The point is that since 4.4.0 the "return new" triggers a notice although there's admittedly no good reason why it should do so. Conceptually/semantically, it does not make any sense, the required workaround is absurd, and, as I stated in my initial post, under some conditions (implementation details of the constructor) the notice does not even occur. I was just curious if there is any chance that this bug is corrected in 4.4.1 >:-). > In PHP5 "=3D& new" is deprecated, so I don't see any reason to=20 > introduce "return new" by ref in PHP5. I was only talking about PHP4, because that is where people are struggling right now. I don't see where assigning by reference from "new" would make any sense at all with PHP5, apart from BC reasons. Of course, assigning new Objects() to parameters passed in by reference would make sense ;), but that is another story. Matthias