|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-22 19:29 UTC] jani@php.net
[2009-09-23 07:10 UTC] romain dot dorgueil at symfony-project dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 22:00:01 2025 UTC |
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