Edit report at https://bugs.php.net/bug.php?id=61697&edit=1

 ID:                 61697
 Updated by:         fel...@php.net
 Reported by:        stadli at gmx dot de
 Summary:            spl_autoload_functions returns lambda functions
                     incorrectly
 Status:             Assigned
 Type:               Bug
 Package:            SPL related
 PHP Version:        5.4.0
-Assigned To:        colder
+Assigned To:        dsp
 Block user comment: N
 Private report:     N

 New Comment:

David, what about this change on 5.5?


Previous Comments:
------------------------------------------------------------------------
[2013-03-11 04:09:41] stadli at gmx dot de

Is there a reason, why this fix still hasn't been implemented?

I'd like to see this bug fixed in PHP 5.5

------------------------------------------------------------------------
[2012-04-12 05:21:32] larue...@php.net

I have made a patch for this, but there is a BC break, that is, 
spl_autoload_functions return lambad_function with name "__lambad_function" 
previously.

after patched, it will return string like "lambad_1".

------------------------------------------------------------------------
[2012-04-12 05:19:39] larue...@php.net

The following patch has been added/updated:

Patch Name: bug61697.phpt
Revision:   1334207979
URL:        
https://bugs.php.net/patch-display.php?bug=61697&patch=bug61697.phpt&revision=1334207979

------------------------------------------------------------------------
[2012-04-12 05:16:05] larue...@php.net

The following patch has been added/updated:

Patch Name: bug61697.patch
Revision:   1334207765
URL:        
https://bugs.php.net/patch-display.php?bug=61697&patch=bug61697.patch&revision=1334207765

------------------------------------------------------------------------
[2012-04-11 18:29:18] stadli at gmx dot de

Description:
------------
spl_autoload_functions() doesn't return the names of lambda-functions 
registered with spl_autoload_register() correctly. Actually it always returns 
'__lambda_func' for every lambda function so you can't use the result with 
spl_autoload_unregister() for example.

Test script:
---------------
<?php

function f1($class) { echo "f1: [[$class]]\n"; }
function f2($class) { echo "f2: [[$class]]\n"; }

spl_autoload_register('f1');
spl_autoload_register('f2');
spl_autoload_register(create_function('$class', 'echo "cf1: [[$class]]\n";'));
spl_autoload_register(create_function('$class', 'echo "cf2: [[$class]]\n";'));

var_dump(spl_autoload_functions());
foreach (spl_autoload_functions() AS $func)
{
        spl_autoload_unregister($func);
}
var_dump(spl_autoload_functions());

?>


Expected result:
----------------
All autoload functions are unregistered

Actual result:
--------------
lambda functions aren't unregistered


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61697&edit=1

Reply via email to