Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7488 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27064 invoked by uid 1010); 2 Feb 2004 19:43:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 26888 invoked from network); 2 Feb 2004 19:43:46 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 2 Feb 2004 19:43:46 -0000 Received: (qmail 6511 invoked from network); 2 Feb 2004 19:43:39 -0000 Received: from guardian.zend.office (HELO ido-comp2.zend.com) (10.1.1.4) by mail.zend.com with SMTP; 2 Feb 2004 19:43:39 -0000 Message-ID: <5.1.0.14.2.20040202214304.03393c08@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 02 Feb 2004 21:43:57 +0200 To: Daniel Convissor , PHP Internals List In-Reply-To: <20040202170557.GA21251@panix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Fwd: Re: [PHP-DEV] Only variables or references can be returned by reference From: andi@zend.com (Andi Gutmans) References: <20040202170557.GA21251@panix.com> Without checking it more thoroughly, I think the former and the latter should work with both PHP 4 and PHP 5. If you want to be 100% certain then the latter will definitely work but I think we allowed the former in PHP 4 too (in a hackish way). Don't sue me if I'm wrong :) Andi At 12:05 PM 2/2/2004 -0500, Daniel Convissor wrote: >Hi: > >This continues to slip between the cracks. Can someone please answer it? > >Thanks, > >--Dan > >----- Forwarded message from Daniel Convissor > ----- > >From: Daniel Convissor >To: PHP Internals List >Date: Wed, 14 Jan 2004 14:46:25 -0500 >Subject: Re: [PHP-DEV] Only variables or references can be returned by >reference > >Hi Andi: > >On Mon, Jan 12, 2004 at 06:31:03PM +0200, Andi Gutmans wrote: > > That should be fine. The following isn't: > > > > function foo() { > > $x = 1; > > return $x; > > } > > > > function &bar() { > > return foo(); > > } > > > > Note: foo isn't returning by reference. > >Good. Can I ask one final clarification, please? Then the following >should be koser in PHP 4 and 5, right? > > function &execute() { > return new DB_result(); > } > >Or would we need to do this to ensure proper opration in both versions? > > function &execute() { > $tmp =& new DB_result(); > return $tmp; > } > >Or does the answer depend on what the constructor method does? Or...? > >----- End forwarded message ----- > >-- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409