From:             alex_boyer at hotmail dot com
Operating system: Windows 2000 Pro
PHP version:      5.0.0RC1
PHP Bug Type:     Zend Engine 2 problem
Bug description:  __autoload called for every class declaration

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

-- 
Edit bug report at http://bugs.php.net/?id=28058&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28058&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28058&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28058&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28058&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28058&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28058&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28058&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28058&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28058&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28058&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28058&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28058&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28058&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28058&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28058&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28058&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28058&r=float

Reply via email to