By David Montoya on Saturday, 27 June 2015
Posted in General
Replies 3
Likes 0
Views 578
Votes 0
I can't find it anywhere other than its usage. Here's a snippet:

public function onRegister (&$post, &$registration) {
return $this->display();
}


Where & is before $post and $registration, what is it used for?
(taken from http://php.net/manual/en/functions.arguments.php)

By default, function arguments are passed by value (so that if the value of the argument within the function is changed, it does not get changed outside of the function). To allow a function to modify its arguments, they must be passed by reference.

To have an argument to a function always passed by reference, prepend an ampersand (&) to the argument name in the function definition:
·
Saturday, 27 June 2015 20:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah! I get it! And now so many functions make much more sense to me. *laughs*
·
Saturday, 27 June 2015 21:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Dave,

Thank you for the info.
·
Monday, 29 June 2015 13:18
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post