Fwd: Re: BYREF_DENY

From: Date: Tue, 14 Dec 1999 21:50:47 +0000
Subject: Fwd: Re: BYREF_DENY
Groups: php.dev 
Request: Send a blank email to php-dev+get-13699@lists.php.net to get a copy of this message
I'm forwarding a letter I replied to Andrei, and his reply to me, regarding the use of function-call-level pass-by-reference (i.e. foo(&$bar);). I'm in favour of gradually deprecating it, but I'd like to hear comments about it, if anyone has any.
Date: Tue, 14 Dec 1999 23:34:30 +0200 To: Andrei Zmievski <andrei@ispi.net>, Andi Gutmans <andi@zend.com> From: Zeev Suraski <zeev@zend.com> Subject: Re: BYREF_DENY At 23:00 14/12/1999 , Andrei Zmievski wrote:
Hi, I had an idea. Sometimes you really want to disallow passing arguments to C functions by reference, but nothing prevents the user from doing so. Is there BYREF_DENY or something similar?
That's pretty remarkable, I talked to Andi about it today. Generally, if we had our way with it and could change the course of history, we would completely remove the ability to selectively send arguments by reference at the function call level. Proper encapsulation would require the function to decide what arguments should be passed by reference and which by value, and disallow the user to override it. We're seriously considering stating that this notation will be deprecated in future versions of PHP/Zend. It'll definitely break tons of existing code, which is why we have to be very careful about it, and provide people with automated script checkers and such. What do you think? As to BYREF_DENY, it depends a bit on what we decide here. I don't think it's difficult to implement, but the question is whether we want to introduce it, just so that we'll remove it in a future version. Perhaps we can already add a 4.0 option to turn off the support for function-call-level pass-by-reference, and instruct people to test their code using it. Zeev
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#13699) next »