From:             craig dot marvelley at boxuk dot com
Operating system: Windows XP
PHP version:      5.3.0RC2
PHP Bug Type:     SPL related
Bug description:  spl_autoload_unregister() removes all autoloaded methods when 
prepending

Description:
------------
The spl_autoload_register function was recently modified (I don't think 
it's documented, though) to allow the pre-pending of functions to the 
stack (see bug #42823).

I'm using pre-pending and am later trying to remove a registered 
function from the end of the stack. This removes ALL methods, not just 
the method I'd intended.

Reproduce code:
---------------
function autoload1() {}

function autoload2() {}

spl_autoload_register('autoload2');

// register autoload1 at the bottom of the stack
spl_autoload_register('autoload1', true, true);

// Output: Array ( [0] => autoload1 [1] => autoload2 )
print_r(spl_autoload_functions());

// unregister autoload2 - autoload1 _should_ be left behind
spl_autoload_unregister('autoload2');

Expected result:
----------------
When running spl_autoload_functions(), I'd expect a single entry to be 
left: array([0] => 'autoload1');

Actual result:
--------------
The array is empty: array();

-- 
Edit bug report at http://bugs.php.net/?id=48493&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48493&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48493&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48493&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48493&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48493&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48493&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48493&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48493&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48493&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48493&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48493&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48493&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48493&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48493&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48493&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48493&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48493&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48493&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48493&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48493&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48493&r=mysqlcfg

Reply via email to