myfunc ($ obj)//
- /.
myfunc (& $obj)// .
, . , ($ obj) null, , $obj, . , , , , , , $obj null, .
:
var x = new Object();
var y = x
function a($_a){}
a($y)
a(& $y)
a(clone $y)
, .
you must pass the identifier by reference if you want to be able to change or delete the identifier inside the function and influence the variable of the external identifier, at the same time being able to return an independently calculated value. for example, serialize an object, save it in a file, return the line of the file, but also clear the identifier so that the object can be cleared from memory.
source
share