[wp-trac] [WordPress Trac] #17111: Remove unnecessary copy-by-reference in do_action()

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 12 01:17:24 UTC 2011


#17111: Remove unnecessary copy-by-reference in do_action()
-------------------------+------------------
 Reporter:  scribu       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.2
Component:  Performance  |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------
Changes (by scribu):

 * component:  General => Performance


Comment:

 It basically transformed:

 {{{
 array( array( &$this ), 'foo' )
 }}}

 into

 {{{
 array( &$this, 'foo' )
 }}}

 for the callback hooked to that action.

 [attachment:conservative.17111.diff] simply removes the reference.

 [attachment:17111.diff] removes the check entirely. Reasons:

 * not a useful behaviour anymore
 * WP core doesn't use it anywhere; instead, it uses the more flexible
 call_user_func_array()
 * unlikely that plugins call {{{do_action( 'whatever', array( &$this )
 );}}}
 * speed improvement

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17111#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list