Re: call-time pass-by-reference feature really deprecated?

From: Date: Thu, 19 Jun 2003 17:29:26 +0000
Subject: Re: call-time pass-by-reference feature really deprecated?
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-152197@lists.php.net to get a copy of this message
I think you are absolutely right. thanx! I'll fix it and see if the warning still remains. /Dorgon Bobby Patel wrote:
Isn't Call-time pass-by-reference the following $variable = myFunction1(&$x); Where myFunction1() is defined as function myFunction1($x) Where as pass-be-reference is called as $variable = myFunction2($x); Where is defined as function myFunction2 (&$Obj); I think the latter is better anyways, because the caller shouldn't know the internals of the function, so you don't know if the function will copy the argument and use that instead. "Dorgon" <dorgon@users.sf.net> wrote in message news:20030619171207.28015.qmail@pb1.pair.com...
Maybe, there's a setting for this in php.ini.
yes. there is:
declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file.
"pass-by-reference" has not been dropped, it is "Call-time
pass-by-reference"
which is being deprecated.
so call-time pass-by-reference is giving parameters as reference to functions, e.g. function returnObjectToAccumulator(&$obj) {...} If this feature is really dropped, how would you implement ConnectionPools for DB-connections for instance, or any classes managing a set of object and providing them by returning references? many OOP design patterns (primarily adopted from java) would not be possible anymore. I think this would be worth talking about. Is there any plausible reason for that decision? /dorgon


« previous php.general (#152197) next »