Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5443 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71425 invoked by uid 1010); 13 Nov 2003 18:52:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71391 invoked from network); 13 Nov 2003 18:52:55 -0000 Received: from unknown (HELO mail.3gstech.com) (216.239.132.110) by pb1.pair.com with SMTP; 13 Nov 2003 18:52:55 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.3gstech.com (Postfix) with ESMTP id DECA79E76C4; Thu, 13 Nov 2003 10:45:43 -0800 (PST) Received: from mail.3gstech.com ([127.0.0.1]) by localhost (fungus [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11551-05; Thu, 13 Nov 2003 10:45:43 -0800 (PST) Received: from 3gstech.com (ip-209-172-92-41.us01.qualys.com [209.172.92.41]) by mail.3gstech.com (Postfix) with ESMTP id 8B60C9E76A2; Thu, 13 Nov 2003 10:45:43 -0800 (PST) Message-ID: <3FB3D1FA.80306@3gstech.com> Date: Thu, 13 Nov 2003 10:48:26 -0800 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5; MultiZilla v1.5.0.3g) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Analysis & Solutions , internals@lists.php.net References: <1068703990.3fb320f6975fb@www.3gstech.com> <20031113065221.GA5862@panix.com> <3FB3CBE7.4020702@3gstech.com> <20031113184350.GA4127@panix.com> In-Reply-To: <20031113184350.GA4127@panix.com> Content-Type: multipart/alternative; boundary="------------040804020207000008040200" Subject: Re: [PHP-DEV] php5 method return reference error? From: waboring@3gstech.com (walt boring) --------------040804020207000008040200 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Analysis & Solutions wrote: >Hi Walt: > >On Thu, Nov 13, 2003 at 10:22:31AM -0800, walt boring wrote: > > >>This is very sad that the only real argument in the bug against fixing >>it was >>that it was hard. Come on! This is such a fundamental thing to be able >>to do. >> >>function &foo() { >> return something_else(); >>} >> >> > >The thing is, as I understand it, references are referring to a variable. >Your example doesn't have a variable to refer to. > >If I misunderstand what's going on, I trust someone on the list will >correct me. > > > > >>going to make a lot >>of php folks upset, and make it much more painfull to upgrade to php5. >> >> > >But the error rests on the people who made the mistake of coding returns >by reference on items that aren't variables. > > This also fails when you do function &foo() { return new bar(); } the something_else() function in my first example could return a variable. function &foo() { return something_else(); } function &something_else() { $foo = 'a'; return $foo; } This also fails, and it shouldn't. Walt --------------040804020207000008040200--