Bug #75049 [Opn->Csd]: spl_autoload_unregister can't handle spl_autoload_functions results
| From: | laruence@php.net | Date: | Wed, 09 Aug 2017 03:31:17 +0000 |
| Subject: | Bug #75049 [Opn->Csd]: spl_autoload_unregister can't handle spl_autoload_functions results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210563@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75049&edit=1
ID: 75049
Updated by: laruence@php.net
Reported by: maxim dot lavrinenko at maximaster dot ru
Summary: spl_autoload_unregister can't handle
spl_autoload_functions results
-Status: Open
+Status: Closed
Type: Bug
Package: SPL related
Operating System: Windows + Debian w/ php 7.0.8-1
PHP Version: 7.1.8
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b06f8cb58bfb7310fff483cb739449e75cd90b79
Log: Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
Previous Comments:
------------------------------------------------------------------------
[2017-08-08 15:16:47] maxim dot lavrinenko at maximaster dot ru
Description:
------------
spl_autoload_unregister can't handle spl_autoload_functions results when autoloader is static
method and register as string with \ prefix
real example:
https://github.com/goaop/framework/blob/master/src/Instrument/ClassLoading/AopComposerLoader.php#L106
buggy when load under Bitrix: https://github.com/matiaspub/bxApiDocs/blob/master/modules/main/lib/loader.php#L462
Test script:
---------------
class Auto { public static function loader() {}}
$autoloader = '\Auto::loader';
echo (int)spl_autoload_register($autoloader);
foreach (spl_autoload_functions() as $loader) {
echo (int)spl_autoload_unregister($loader);
}
echo (int)count(spl_autoload_functions());
Expected result:
----------------
110
Actual result:
--------------
101
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75049&edit=1