Deltran Posted January 23, 2007 Share Posted January 23, 2007 I've been having a hard time trying to find an answer to this:What is the difference between [b]function myFunc()[/b] and [b]function &myFunc() [/b]??? Link to comment https://forums.phpfreaks.com/topic/35422-what-does-making-a-function-a-reference-do/ Share on other sites More sharing options...
Jessica Posted January 23, 2007 Share Posted January 23, 2007 I've never seen that on functions. I know you can pass a variable by reference. Normally variables are passed by value, meaning a copy is made, whereas reference points to the actual variable.Edit: http://www.php.net/manual/en/language.references.return.php"Returning by-reference is useful when you want to use a function to find which variable a reference should be bound to." Link to comment https://forums.phpfreaks.com/topic/35422-what-does-making-a-function-a-reference-do/#findComment-167551 Share on other sites More sharing options...
Deltran Posted January 23, 2007 Author Share Posted January 23, 2007 [quote author=jesirose link=topic=123717.msg511743#msg511743 date=1169585730]I've never seen that on functions. I know you can pass a variable by reference. Normally variables are passed by value, meaning a copy is made, whereas reference points to the actual variable.Edit: http://www.php.net/manual/en/language.references.return.php"Returning by-reference is useful when you want to use a function to find which variable a reference should be bound to."[/quote]Ah, there it is! Thank you so much! Link to comment https://forums.phpfreaks.com/topic/35422-what-does-making-a-function-a-reference-do/#findComment-167562 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.