php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28058 __autoload called for every class declaration
Submitted: 2004-04-19 14:52 UTC Modified: 2004-05-01 01:22 UTC
From: alex_boyer at hotmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0RC1 OS: Windows 2000 Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alex_boyer at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-04-19 14:52 UTC] alex_boyer at hotmail dot com
Description:
------------
__autoload is called for every class declaration that extends a parent class, even if the parent declaration file is included.

Reproduce code:
---------------
index.php:
require_once "b.php";
function __autoload($theclass){
	echo "Auto load\n";
	require_once($theclass.".php");
}
$obj = new b();
$obj->hello();
b.php:
require_once "a.php";
class b extends a{
	function hello() { echo "B";}
}
a.php:
class a{
	function hello() {echo "A";}
}


Expected result:
----------------
B

Actual result:
--------------
Auto load
B

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-19 20:34 UTC] helly@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip
 [2004-04-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2004-05-01 01:22 UTC] alex_boyer at hotmail dot com
It works with new CVS version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC