[wp-hackers] Why pass by reference?
wp at andrewnacin.com
Fri Jul 12 20:10:06 UTC 2013
It was necessary in PHP 4, it is no longer necessary in PHP 5.
On Fri, Jul 12, 2013 at 3:59 PM, Micky Hulse <mickyhulse.lists at gmail.com>wrote:
> For the second example:
> Why pass $this by reference? Specifically:
> Occasionally, I'll see WP example code (like above) where the author
> passes $this by reference.
> Other examples, like:
> ... $this isn't passed by reference.
> Sorry if this is a dumb question, but (within the context of coding
> OOP for WP) how do I determine if I need to pass $this by reference?
> Is there a good WP/PHP rule of thumb?
> For the add_meta_box() example, I don't see any obvious reasons why
> passing by reference is required and/or better than not. :D
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers