calling by reference?
| From: | Sander Pilon | Date: | Sun, 15 Aug 1999 12:07:21 +0000 |
| Subject: | calling by reference? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-3434@lists.php.net to get a copy of this message | ||
Is this desired behaviour?
--> You have two functions taking a string pointer
--------------
function foo(&$string)
{
bar($string);
}
function bar(&$string)
{
// replace some stuff in $string
}
$s = "hello, world!";
foo($s);
---------------
The 'call by reference' does not seem to work properly if bar() was defined
AFTER foo(), but it DOES work properly if bar() was defined BEFORE foo().
Note that in both cases the functions are executed. (no errors/warnings)
Sander Pilon - President, 3DN.NET, Inc.
http://www.3dnews.net
http://www.3dn.net
mail: sander@3dnews.net