|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44144 spl_autoload_functions() should return object instance when appropriate
Submitted: 2008-02-18 02:07 UTC Modified: 2009-09-22 17:40 UTC
From: Assigned: colder (profile)
Status: Closed Package: SPL related
PHP Version: 5.3CVS-2008-02-18 (CVS) OS: Irrelevant
Private report: No CVE-ID: None
 [2008-02-18 02:07 UTC]
spl_autoload_functions() should return object instances, not class names, when appropriate.

Reproduce code:
class Foo {
  public function nonstaticMethod() {}
$foo = new Foo;
spl_autoload_register(array($foo, 'nonstaticMethod'));
$funcs = spl_autoload_functions();
print_r((int) is_object($func[0][0]));

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-29 13:48 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2008-02-29 21:31 UTC]
Thanks for the fix. Do you think, by any chance, we can sneak this into PHP 5.2, or is that impossible?
 [2009-07-28 22:25 UTC]
Automatic comment from SVN on behalf of bjori
Log: MFH: Fixed bug #44144 & add test
 [2009-09-22 17:40 UTC]
Please do not do such change again in stable releases!

It is obviously a BC break and forces users to have a work around for 5.2.11 and later while keeping the old code for 5.2.10 or earlier.

I can understand that we like to match what is done in call_user_func, but it should not be done at the price of BC in a stable branche (has behaved like that for many releases already).
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 19 09:03:37 2021 UTC