#44144 [Csd]: spl_autoload_functions() should return object instance when appropriate
| From: | pajoye@php.net | Date: | Tue, 22 Sep 2009 17:40:53 +0000 |
| Subject: | #44144 [Csd]: spl_autoload_functions() should return object instance when appropriate | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-142704@lists.php.net to get a copy of this message | ||
ID: 44144
Updated by: pajoye@php.net
Reported By: ezyang@php.net
Status: Closed
Bug Type: SPL related
Operating System: Irrelevant
PHP Version: 5.3CVS-2008-02-18 (CVS)
Assigned To: colder
New Comment:
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).
Previous Comments:
------------------------------------------------------------------------
[2009-07-28 22:25:31] svn@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=286476
Log: MFH: Fixed bug #44144 & add test
------------------------------------------------------------------------
[2008-02-29 21:31:38] ezyang@php.net
Thanks for the fix. Do you think, by any chance, we can sneak this into
PHP 5.2, or is that impossible?
------------------------------------------------------------------------
[2008-02-29 13:48:41] colder@php.net
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2008-02-18 02:07:06] ezyang@php.net
Description:
------------
spl_autoload_functions() should return object instances, not class
names, when appropriate.
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:
----------------
1
Actual result:
--------------
0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44144&edit=1