From: wolfgang dot forstmeier at siemens dot com Operating system: All PHP version: Irrelevant PHP Bug Type: Class/Object related Bug description: PHP object creation crashes
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 bug report at http://bugs.php.net/?id=27977&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27977&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27977&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27977&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27977&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27977&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27977&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27977&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27977&r=support Expected behavior: http://bugs.php.net/fix.php?id=27977&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27977&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27977&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27977&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27977&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27977&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27977&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27977&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27977&r=float