[wp-trac] [WordPress Trac] #25160: Unnecessarily passing $this by reference in core

WordPress Trac noreply at wordpress.org
Sun Jan 4 06:45:12 UTC 2015


#25160: Unnecessarily passing $this by reference in core
-------------------------------------------------+-------------------------
 Reporter:  jdgrimes                             |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  General                              |  Release
 Severity:  normal                               |     Version:
 Keywords:  has-patch needs-testing needs-codex  |  Resolution:
  3.9-early                                      |     Focuses:
                                                 |  performance
-------------------------------------------------+-------------------------

Comment (by wonderboymusic):

 In [attachment:25160.diff], I think these are all safe, but will sit on it
 for now.

 `do_action_ref_array( 'action', array( &$this ) );`

 becomes `do_action( 'action', $this );`

 Only touches actions that pass one arg: `$this`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25160#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list