Using “&” when passing function to action hook

I have noticed some WordPress plugin classes pass the class method to a hook using the ampersand prefix.

for example:

Read More
add_action( 'somehook', array( &$this, 'some_function' ) );

Is there a specific reason to do so?

I understand the & makes it pass a reference instead of an instance but most of the time I see it used that seems irrelevant as it is a method and not an object.

Is there a particular reason to do it this way with wordpress action hooks?

Related posts

Leave a Reply

1 comment