You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace EG(autoload_func) with a C level zend_autoload hook.
This avoids having to do one indirection through PHP function
calls. The need for EG(autoload_func) was a leftover from the
__autoload() implementation.
Additionally, drop special-casing of spl_autoload(), and instead
register it just like any other autoloading function. This fixes
bug #71236 as a side-effect.
Finally, change spl_autoload_functions() to always return an array.
The distinction between false and an empty array no longer makes
sense here.
ClosesGH-5696.
/* The compiler is not-reentrant. Make sure we __autoload() only during run-time
956
-
* (doesn't impact functionality of __autoload()
957
-
*/
953
+
/* The compiler is not-reentrant. Make sure we autoload only during run-time. */
958
954
if ((flags&ZEND_FETCH_CLASS_NO_AUTOLOAD) ||zend_is_compiling()) {
959
955
if (!key) {
960
956
zend_string_release_ex(lc_name, 0);
961
957
}
962
958
returnNULL;
963
959
}
964
960
965
-
if (!EG(autoload_func)) {
961
+
if (!zend_autoload) {
966
962
if (!key) {
967
963
zend_string_release_ex(lc_name, 0);
968
964
}
969
965
returnNULL;
970
-
971
966
}
972
967
973
-
/* Verify class name before passing it to __autoload() */
968
+
/* Verify class name before passing it to the autoloader. */
974
969
if (!key&&strspn(ZSTR_VAL(name), "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\\") !=ZSTR_LEN(name)) {
0 commit comments