Re: PHP5 and pass by reference bug.
| From: | Red Wingate | Date: | Sat, 17 Jul 2004 00:34:38 +0000 |
| Subject: | Re: PHP5 and pass by reference bug. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190786@lists.php.net to get a copy of this message | ||
Maybe you recheck the dokumentation on what exactly referenzes are. Do you expect the function to alter the string "something here" and every-
time you later print the string within your script you get the altered one?
ONLY variables can be passed by referenze !
-- red
Daevid Vincent wrote:
So, I'm getting all these errors/warnings in PHP5 now saying that I have to put the & on the function and not in the passing (which sorta makes sense and puts the burden on the function rather than the user, which I like too). So I spend the time to go and fix several thousand lines of code. Then I start to see these other errors... Maybe I'm missing something, but this seems like a glaring bug in passing by reference that nobody caught... say you have function foo(&$bar) { } well that works great as long as you use it like foo($x); but if you try foo("something here"); Or foo( array('a','b','c') ); it shits the bed. :-(