ID: 27977 Updated by: [EMAIL PROTECTED] Reported By: wolfgang dot forstmeier at siemens dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: All PHP Version: Irrelevant New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php You need to declared classes before use if you inherit them. Previous Comments: ------------------------------------------------------------------------ [2004-04-13 09:54:47] wolfgang dot forstmeier at siemens dot com Description: ------------ Hi, if you create an object befor you had described your class this will let crash your php code. If you create the object after you had described your class code all is fine. Reproduce code: --------------- File 1 with Class 1 <?php class f { var $f = null; function f() { $this->f = 5; } } ?> File 2 with Class 2 <?php require_once('test_a.php'); $b = new xy(); class xy extends f{ function xy() { echo $this->f; } } ?> Expected result: ---------------- The output had to be 5 Actual result: -------------- Fatal error: Cannot instantiate non-existent class: xy in c:\server_scripts\htdocs\scripts\test.php on line 3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27977&edit=1