saf Posted December 20, 2006 Share Posted December 20, 2006 HiI recently came across a function in one of the php books and didn't have a clue as to why someone would use an ampersand before a function name.[code]function &test($var){ $result = $var+1; return $result;}[/code]Can anyone explain what the purpose of the ampersand (&) is (I'd prefer an example of it)?Thanks,Saf Link to comment https://forums.phpfreaks.com/topic/31421-function-w-preceding-ampersand/ Share on other sites More sharing options...
trq Posted December 20, 2006 Share Posted December 20, 2006 You will want to read the manuals section on [url=http://www.php.net/manual/en/language.references.php]references[/url]. Link to comment https://forums.phpfreaks.com/topic/31421-function-w-preceding-ampersand/#findComment-145483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.