note 99546 modified in language.references.pass by danbrown
| From: | danbrown@php.net | Date: | Tue, 24 Aug 2010 03:39:48 +0000 |
| Subject: | note 99546 modified in language.references.pass by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171961@lists.php.net to get a copy of this message | ||
Passing variable reference to function instead of declaring the function parameter type to reference
also could get the result as expected.
<?php
$string = 'string';
function change($str) {
$str = 'str';
}
change(&$string);
echo $string;
?>
yeild
str
--was--
Passing variable reference to function instead of declaring the function parameter type to reference
also could get the result as expected.
$string = 'string';
function change($str) {
$str = 'str';
}
change(&$string);
echo $string;
yeild
str
http://php.net/manual/en/language.references.pass.php