[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern

WordPress Trac noreply at wordpress.org
Fri Sep 9 02:59:01 UTC 2016


#37699: Death to Globals Episode #1: A Registry, A Pattern
----------------------------+------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  4.7
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------

Comment (by TimothyBlynJacobs):

 I think people are talking about two different aspects of object
 assignment here. If any changes to `wpdb` state are made to the ''same''
 global, then those changes will of course be in any property that
 references `wpdb` because they are both pointing to the same object.

 However, if a plugin stomps the `wpdb` global, the ''new'' object won't be
 what the class property references.

 https://3v4l.org/eTaI5

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


More information about the wp-trac mailing list