[wp-trac] [WordPress Trac] #41134: Remove __autoload compat provided
WordPress Trac
noreply at wordpress.org
Fri Jun 23 08:15:56 UTC 2017
#41134: Remove __autoload compat provided
----------------------------+-----------------------------
Reporter: ayeshrajans | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version: trunk
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
Hi everyone,
This is my first ticket in WP Trac, so I apologize in advance and
appreciate shedding some lights if I'm doing anything unconventional.
With Wordpress now recommending PHP 7, I believe we should take care of
compatibility issues with modern PHP versions. PHP 7.2 alpha is released,
and I decided to see and fix any incompatibilities with it. 7.2 has not
reached a feature-freeze yet, but we already know the deprecated
features/functions in it.
Vanilla Wordpress 4.8, running on PHP 7.2.alpha2 (todays version) has one
consistent notice:
{{{
Deprecated: __autoload() is deprecated, use spl_autoload_register()
instead in wp-includes\compat.php on line 502.
}}}
There is a comment in compat.php that says SPL ''can'' be disabled. This
is true for PHP 5.2 users,but since PHP 5.3, SPL ''can not'' be disabled
(http://php.net/manual/en/spl.installation.php). This noticed is raised by
the PHP compiler itself, and not during the execution. This means the
notice will be raised as soon as the compiler "sees" the function.
wordpress.org stats show that we only have PHP 5.2 user base of 4.7
(https://wordpress.org/about/stats/). Quite often, one need to recompile
PHP in order to disable SPL extension, and it makes a PHP installation
hardly usable with modern PHP applications.
I suggest that we remove the compat.php `__autoload` and its other compat
functions (spl_register_*) to avoid the PHP notice in PHP 7.2, and I
believe it's a fair trade-off.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41134>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list