|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-02-04 16:06 UTC] php-dev at zerocue dot com
[2012-02-05 14:15 UTC] frederic dot hardy at mageekbox dot net
[2012-10-22 11:25 UTC] john dot papaioannou at gmail dot com
[2016-06-20 14:26 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2016-06-20 14:26 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Description: ------------ It's possible to register a protected method as an autoloader callback with the function spl_autoload_register(). Test script: --------------- <?php class autoloader { function register() { spl_autoload_register(array($this, 'requireClass')); } protected function requireClass() {} } $autoloader = new autoloader(); $autoloader->register(); $autoloadFunctions = spl_autoload_functions(); foreach ($autoloadFunctions as $autoloadFunction) { spl_autoload_unregister($autoloadFunction); } foreach ($autoloadFunctions as $autoloadFunction) { spl_autoload_register($autoloadFunction); } Expected result: ---------------- Cannot register the protected method autoload::requireClass() as a callback Actual result: -------------- Passed array does not specify a callable method (cannot access protected method autoloader::requireClass())