Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#46630 closed enhancement (duplicate)

Remove SPL-Autoload polyfill

Reported by: ayeshrajans's profile ayeshrajans Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Bootstrap/Load Keywords: has-patch
Focuses: performance Cc:


Follow up to #46594 and #40109

PHP 7.2 deprecated the __autoload function to autoload PHP classes in favor of spl_autoload_register. For PHP versions <= 5.2, one can have PHP versions without SPL, which added the spl_autoload_register.

To make sure tests pass, I split the WordPress's __autoload implementation to a separate file spl-autoload-compat.php.

Now that we require PHP 5.6.30 in trunk, we can safely remove this polyfill!

Attachments (1)

46630.patch (3.6 KB) - added by ayeshrajans 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @ayeshrajans
5 years ago

  • Keywords has-patch added
  • Version changed from trunk to 4.2

#3 @pento
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thank you for the ticket and patch @ayeshrajans!

I'm going to roll this into #47698, where similar code cleanup is taking place.

#4 @pento
5 years ago

In 45637:

Code Modernisation: Remove the SPL autoloader polyfill.

As of PHP 5.3, the SPL extension cannot be disabled, so we no longer need this polyfill.

The file is kept with a _deprecated_file() call, to alert any plugins or themes that may be loading it directly.

Props jrf, ayeshrajans.
See #47698, #46630.

Note: See TracTickets for help on using tickets.