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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: buchner dot johannes at gmx dot at
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC