Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5478 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10109 invoked by uid 1010); 14 Nov 2003 22:51:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10033 invoked from network); 14 Nov 2003 22:51:13 -0000 Received: from unknown (HELO mail3.panix.com) (166.84.1.74) by pb1.pair.com with SMTP; 14 Nov 2003 22:51:13 -0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mail3.panix.com (Postfix) with ESMTP id D1A3A98347 for ; Fri, 14 Nov 2003 17:51:12 -0500 (EST) Received: (from analysis@localhost) by panix5.panix.com (8.11.6p2-a/8.8.8/PanixN1.1) id hAEMpCu27205 for internals@lists.php.net; Fri, 14 Nov 2003 17:51:12 -0500 (EST) Date: Fri, 14 Nov 2003 17:51:12 -0500 To: PHP Internals List Message-ID: <20031114225112.GA27104@panix.com> References: <20031112174553.GA23321@panix.com> <20031112174553.GA23321@panix.com> <5.1.0.14.2.20031114222245.038dc6d0@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20031114222245.038dc6d0@127.0.0.1> User-Agent: Mutt/1.4.1i Subject: Re: [PHP-DEV] return by reference behaviors in PHP 5 From: danielc@analysisandsolutions.com (Daniel Convissor) Hi Andi: On Fri, Nov 14, 2003 at 10:24:45PM +0200, Andi Gutmans wrote: > I'll try and take a look at it next week (I had no time this week). Understandable. Thanks for the update. > The problem is that there where bugs in the past when returning by > reference not variables, which could cause memory corruptions. Yes, yes. > In order not to completely break every script in some > cases we can turn a blind eye and allow it (such as return 4;) because it > can be dealt with. I assume by something along the lines of internally assigning it to a variable with a pointer to it (pardon the potential lack of computer science / C programming terminology). I guess, then this begs the already answered question -- why not do the same with methods, etc? The answer thus far has been that it's too hard to do, which is okay by me. > Anyway, as I said it's something I need to look into more detail again > which I'll do soon. Just to clarify, my main concern is that everyone know what the behavior is going to be and that it's not going to change again, then document the precise rules. I'll be glad to help with documentation, when it comes to that point. Though, it seems the behavior should be consistent -- sometimes I'm too logical :) -- so returning a variable is okay and the rest of it should be blocked, OR rework the system so anything can be returend. Thanks again, --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ 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 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409