php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37152 __autoload is called with 'self'
Submitted: 2006-04-21 12:07 UTC Modified: 2006-04-21 12:56 UTC
From: buchner dot johannes at gmx dot at Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.2 OS: Any
Private report: No CVE-ID: None
 [2006-04-21 12:07 UTC] buchner dot johannes at gmx dot at
Description:
------------
autoloader shouldn't be called with the parameter 'self' or call_user_func(array('self','method')) shouldn't be working.

Reproduce code:
---------------
class A{
	function A(){
		call_user_func(array("self","f"));
	}
	function f(){
		echo "A::f()<br/>";
	}
}

function __autoload($class){
	echo "autoloader: $class <br/>";
}

$a = new A();

Expected result:
----------------
just: A::f()

Actual result:
--------------
autoloader: self
A::f()
autoloader is called with the argument self as classname.

Of course, 
call_user_func(array($this,"f"));
 is a workaround.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-21 12:34 UTC] mike@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

It's self not 'self'.
 [2006-04-21 12:56 UTC] mike@php.net
Dupe of bug #37138
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 18:01:32 2024 UTC