Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7475 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40553 invoked by uid 1010); 2 Feb 2004 17:05:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 40527 invoked from network); 2 Feb 2004 17:05:58 -0000 Received: from unknown (HELO mail3.panix.com) (166.84.1.74) by pb1.pair.com with SMTP; 2 Feb 2004 17:05:58 -0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mail3.panix.com (Postfix) with ESMTP id 23092981C9; Mon, 2 Feb 2004 12:05:58 -0500 (EST) Received: (from analysis@localhost) by panix5.panix.com (8.11.6p2-a/8.8.8/PanixN1.1) id i12H5wH21441; Mon, 2 Feb 2004 12:05:58 -0500 (EST) Date: Mon, 2 Feb 2004 12:05:58 -0500 To: PHP Internals List , Andi Gutmans Message-ID: <20040202170557.GA21251@panix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: Fwd: Re: [PHP-DEV] Only variables or references can be returned by reference From: danielc@analysisandsolutions.com (Daniel Convissor) 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