php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49629 Regression in 5.2 caused by #44144
Submitted: 2009-09-22 17:40 UTC Modified: 2009-09-23 07:10 UTC
From: romain dot dorgueil at symfony-project dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.11 OS: linux 2.6.18-4-vserver-686
Private report: No CVE-ID: None
 [2009-09-22 17:40 UTC] romain dot dorgueil at symfony-project dot com
Description:
------------
In #44144, it was said "spl_autoload_functions() should return object 
instances, not class names, when appropriate."

"should" and "when appropriate" seems a bit hazardous, to speak about 
a 
feature that has been working some way until 5.2.10

After a discussion with Pierre, he summed it up well as :

<Pierre> that's a very bad idea and break BC for a behavior that has 
existed for a good dozen releases


I understand that maybe we want it to behave somehow else in future 
versions, but I'm not sure minor releases of php 5.2 are the best 
place for it.

I will understand very well if this ticket is closed as invalid or 
wontfix (as the damage is already done, it's for sure a good idea not 
to change again in .12), but I wanted to report it to show how a so 
little BC change can affect some projects.


Reproduce code:
---------------
<?php
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:
----------------
0

Actual result:
--------------
1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-22 19:29 UTC] jani@php.net
Changing it again would be rather idiotic. It's done, live with it.
 [2009-09-23 07:10 UTC] romain dot dorgueil at symfony-project dot com
exactly what I meant.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 13:01:31 2025 UTC