From: Operating system: Windows 7 PHP version: 5.3.6 Package: Class/Object related Bug Type: Bug Bug description:Interfaces avoids Classes to exist
Description: ------------ First at all, one consideration about one of the informations provided in this form is the PHP version. I'm not using 5.3.6. I'm using 5.3.3, which is not listed. I f I chose "earlier", the form won't submit. I can be wrong, but I think this bug is not fixed in newer versions, because it's not a very common use. The whole thing is, when interfaces and classes are in the same namespace AND in same file, the 'implements' breaks the execution of the 'extends'. See Code #1 As expected I can see "Message from Second Class", without quotes. But if I add a interface (see Code #2) I get a Fatal Error: "Class 'Test\Zero' not found", when it could be expected the same result as before. But why this is important, if the best practices are to develop by following an organized structure, with each class/interface in its own file? The thing is, when DEVELOPING, this kind of organization is very useful, but if the code produced during development stage is a little library, if all the classes and interfaces are coded in one single file, only one call to require_once is needed, and the code execution is three times faster than when using an autoloader resource. Note about CodePad's codes: I'd only saved the lines of code in this site, they don't work from it, due PHP versions. But all the tests I made was in machine with the configurations posted. Test script: --------------- [ Code #1 ] http://codepad.org/pDOAiqBa [ Code #2 ] http://codepad.org/a42WgIT3 Expected result: ---------------- As said in Bug's Description, "Message from Second Class", witout quotes. Actual result: -------------- With the first code, I can see the expected result. With the second code, as I said, I see a Fatal Error. If the stack traces helps, here is it: Fatal error: Class 'Test\Test\Zero' not found in C:\root\Test\Library.php on line 5 Call Stack # Time Memory Function Location 1 0.0004 326896 {main}( ) ..\index.php:0 2 0.0018 334024 require_once( 'C:\root\Test\Framework.php' ) ..\index.php:3 Dump $_GET Dump $_POST -- Edit bug report at https://bugs.php.net/bug.php?id=55103&edit=1 -- Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55103&r=trysnapshot52 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55103&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55103&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55103&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55103&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55103&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55103&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55103&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55103&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55103&r=support Expected behavior: https://bugs.php.net/fix.php?id=55103&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55103&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55103&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55103&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55103&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55103&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55103&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55103&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55103&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55103&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55103&r=mysqlcfg Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55103&r=trysnapshot54