[wp-trac] [WordPress Trac] #48963: Deprecate and replace globals in core with service container

WordPress Trac noreply at wordpress.org
Fri Dec 13 11:36:20 UTC 2019


#48963: Deprecate and replace globals in core with service container
-------------------------+-----------------------------
 Reporter:  taraschr     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Global variables are "dark" legacy from PHP 4 but widely using in
 WordPress. Globals are dangerous and causing many problems - it is too
 easy accidentally rewrite or unset, their behavior can be very
 unpredictable. I think all problems are well known.

 I suggest to add something like service container to WordPress core. It
 will not complicate understanding of WordPress core but will do more
 clearly and predictable in development process.

 Globals can remain with that but deprecated and no longer recommended for
 use anymore.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48963>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list