note 105291 added to language.references.pass
| From: | thelordofcheese at osu1 dot php dot net | Date: | Mon, 08 Aug 2011 03:37:12 +0000 |
| Subject: | note 105291 added to language.references.pass | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182308@lists.php.net to get a copy of this message | ||
>>northhero at gmail dot com
You dolt. Of COURSE the global $string won't be changed. It's called SCOPE! The globla
variable $string wasn't passed by reference, but when the instance of call_user_funct()
executes change() the temporary local variable $string belonging to that instance of
call_user_funct() is passed to change() by reference as defined by the parameter definition of
change(). Of COURSE you'd have to pass $string by reference to call_user_funct() for the
reference to the global instance of $string to be referenced by the instance of change() called by
that instance of call_user_funct(). This is the case for ANY function that doesn't define the
parameter as passed by reference in the function definition. And it scales through all function
calls inside every function called by the entire chain of calling functions.
----
Server IP: 69.147.83.197
Probable Submitter: 24.3.195.43
----
Manual Page -- http://www.php.net/manual/en/language.references.pass.php
Edit -- https://master.php.net/note/edit/105291
Del: integrated -- https://master.php.net/note/delete/105291/integrated
Del: useless -- https://master.php.net/note/delete/105291/useless
Del: bad code -- https://master.php.net/note/delete/105291/bad+code
Del: spam -- https://master.php.net/note/delete/105291/spam
Del: non-english -- https://master.php.net/note/delete/105291/non-english
Del: in docs -- https://master.php.net/note/delete/105291/in+docs
Del: other reasons-- https://master.php.net/note/delete/105291
Reject -- https://master.php.net/note/reject/105291
Search -- https://master.php.net/manage/user-notes.php