|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-01-10 18:14 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Description: ------------ When using spl_autoload_register with two instances of the same class name, the autoload stack only stores one function callback instead of two. Reproduce code: --------------- class MyAutoloader { function __construct($directory_to_use) {} function autoload($class_name) { // code to autoload based on directory } } $autloader1 = new MyAutoloader('dir1'); spl_autoload_register(array($autloader1, 'autoload')); $autloader2 = new MyAutoloader('dir2'); spl_autoload_register(array($autloader2, 'autoload')); print_r(spl_autoload_functions()); Expected result: ---------------- Array ( [0] => Array ( [0] => MyAutoloader [1] => autoload ) [1] => Array ( [0] => MyAutoloader [1] => autoload ) ) Actual result: -------------- Array ( [0] => Array ( [0] => MyAutoloader [1] => autoload ) )