[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern
WordPress Trac
noreply at wordpress.org
Fri Sep 9 02:31:24 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 dd32):
Replying to [comment:87 GaryJ]:
> I think there may actually be a change (desired or not) in behaviour
here.
>
> With the `global $wpdb` in each method, you import the latest state of
`$wpdb` when the method is called.
That was true in PHP4, but from PHP5 onwards all object assignments are
done by reference, meaning it's just yet-another-variable which references
the global `$wpdb` contents.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37699#comment:88>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list