From: Operating system: Mac OS X 10.6 PHP version: 5.3.3 Package: Scripting Engine problem Bug Type: Bug Bug description:Class not found caused by require_once
Description: ------------ A weird bug, appears only when the script contains require_once: A class is defined with an interface implemented, but the PHP interpreter produces a fatal error saying class not defined. But everything goes well if the class doesn't implemented an interface. Test script: --------------- Download this file, and unzip it: http://files.cnblogs.com/ExSystem/FrameworkDSW.zip Make sure your php include_path contains the parent directory of FrameworkDSW, and to set error reporting level to E_ALL in case. Run FrameworkDSW\System.php, and get the fatal error. ****And only the classes defined before the declaration of TObject inside System.php are declared succesfully(I guess it by invoking get_declared_classes()). Then modify the line 285 of System.php to class TObject { rather than class TObject implements IInterface { and run it again, to see the difference. ****And all the classes inside System.php are declared successfully. Expected result: ---------------- <Nothing> Actual result: -------------- <br /> <b>Fatal error</b>: Class 'TObject' not found in <b>{your_include_path}\FrameworkDSW\Utilities.php</b> on line <b>81</b><br /> -- Edit bug report at http://bugs.php.net/bug.php?id=53508&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53508&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53508&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53508&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53508&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53508&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53508&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53508&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53508&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53508&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53508&r=support Expected behavior: http://bugs.php.net/fix.php?id=53508&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53508&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53508&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53508&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53508&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53508&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53508&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53508&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53508&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53508&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53508&r=mysqlcfg