tags:

views:

21

answers:

2

Heya, so I understand how the following should be used:

function test(&$obj) {
    {...}
}

But what does the following represent?

function &test(&$obj) {
    {...}
}

Any help would be appreciated.

+2  A: 

This declaration:

function &test(&$obj)

Represents a function that takes in a reference to a variable as a parameter and returns a variable by reference.

BoltClock
+1  A: 

The function will return reference to the variable instead of the value.

See Returning References (PHP manual) for more information.

Ondrej Slinták
+1 for PHP manual link. For some strange reason none of my Google searches turned that page up.
BoltClock
thanks. purrrr-fect.
onassar