Reputation: 449
I am tryingto pass the reference of a object to a php function , can anyone show me an example. I did look on google, for about an hour but could not find completely what I was looking for.
Thanks
Upvotes: 1
Views: 659
Reputation: 34254
Objects are always passed by reference in PHP:
$a = new Class();
$b = new OtherClass();
$a->setB($b);
This will pass $b
as reference to $a->setB()
Upvotes: 4