PHP 8.5.0 Alpha 4 available for testing

Voting

: max(nine, seven)?
(Example: nine)

The Note You're Voting On

joachim at lous dot org
22 years ago
So to make a by-reference setter function, you need to specify reference semantics _both_ in the parameter list _and_ the assignment, like this:

class foo{
var $bar;
function setBar(&$newBar){
$this->bar =& newBar;
}
}

Forget any of the two '&'s, and $foo->bar will end up being a copy after the call to setBar.

<< Back to user notes page

To Top