diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index dda04cbd017..2e34f46e640 100755 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -415,6 +415,7 @@ PHP_FUNCTION(spl_autoload_call) (ht)->pListTail->pListNext = (ht)->pListHead; \ (ht)->pListHead = (ht)->pListTail; \ (ht)->pListTail = (ht)->pListHead->pListLast; \ + (ht)->pListHead->pListNext->pListLast = (ht)->pListHead;\ (ht)->pListTail->pListNext = NULL; \ (ht)->pListHead->pListLast = NULL; diff --git a/ext/spl/tests/bug48493.phpt b/ext/spl/tests/bug48493.phpt new file mode 100644 index 00000000000..d0be7f8ec71 --- /dev/null +++ b/ext/spl/tests/bug48493.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: Bug #48493 spl_autoload_unregister() can't handle prepended functions +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(9) "autoload1" + [1]=> + string(9) "autoload2" +} +array(1) { + [0]=> + string(9) "autoload1" +}