Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35945 invoked by uid 1010); 3 Oct 2005 13:09:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 35930 invoked from network); 3 Oct 2005 13:09:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2005 13:09:31 -0000 X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([82.94.239.5:58847] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 2C/A5-54476-98D21434 for ; Mon, 03 Oct 2005 09:09:30 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j93D9Q9m001799 for ; Mon, 3 Oct 2005 15:09:26 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j93D9M8Y001785 for ; Mon, 3 Oct 2005 15:09:22 +0200 Date: Mon, 3 Oct 2005 15:09:22 +0200 (CEST) X-X-Sender: derick@localhost To: PHP Developers Mailing List Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdi-ict.nl Subject: $ref =& $this; From: derick@php.net (Derick Rethans) Hello, Dmitry committed a fix earlier to ignore the & in the statement above. I think this is not a good thing to do as it's simply conceptually wrong. The first thing is that ignoring syntax without issuing a warning is dubious because people might think it does actually work, and secondly because I think that the code above is wrong anyway - somewhat in the same way that "$this = new foo();" is wrong. There is never any need to assign $this by reference, nor to pass it by reference to a function as it's an object anyway, making the references pointless - I would even go as far as disallowing passing $this by references to a function - where the reference has to be ignored again, otherwise it allows you to chantge $this to a different object with: class Foo { function byRef(&$f) { $f = new Bar(); } function modifyThis() { $this->byRef($this); } } I think we should prevent people from writing syntax like this, as it is not obvious what is going to happen. This means that we should revert Dmitry's patch. regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org