Are PHP5 objects passed by reference?
Posted
by morpheous
on Stack Overflow
See other posts from Stack Overflow
or by morpheous
Published on 2010-04-26T16:17:17Z
Indexed on
2010/04/26
16:23 UTC
Read the original article
Hit count: 148
php
I cant seem to get any consistent info on this. Different sources appear to say different things and trhe venerable php.net iteslf (appears) not to explicitly state this - although I must admit, I only had a quick look.
In cases where I am passing around 'heavy' objects, I need to pass by reference, but I dont want to keep typing:
function foo(TypeName& $obj)
if I can get away with simply,
function foo(TypeName $obj)
So what does the standard say?
© Stack Overflow or respective owner