Edit report at http://bugs.php.net/bug.php?id=54327&edit=1
ID: 54327 Updated by: [email protected] Reported by: j dot verloop at gmail dot com Summary: Interface extending problem -Status: Open +Status: Bogus Type: Bug Package: Scripting Engine problem Operating System: OSX PHP Version: 5.3.6 Block user comment: N Private report: N 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 This is expected, for such case you need to implement the interface before using it. <?php namespace A\B; interface z { } interface C extends z {} namespace A; class B implements \A\B\C { } Previous Comments: ------------------------------------------------------------------------ [2011-03-21 00:00:44] j dot verloop at gmail dot com Description: ------------ PHP can't seem to find an interface when it's extended by another one and implemented by a class located in a different namespace (when stored in 1 single file). Test script: --------------- I do have 3 examples: Example 1: test.php namespace A; class B implements \A\B\C, \Countable { public function count() { return 1; } } namespace A\B; interface C {} everything is OK! ----------------- Example 2: test.php namespace A\B; interface C extends \Countable {} namespace A; class B implements \A\B\C { public function count() { return 1; } } everything is OK! ----------------- Example 3: test.php namespace A; class B implements \A\B\C { public function count() { return 1; } } namespace A\B; interface C extends \Countable {} Fatal error Expected result: ---------------- No fatal error ;) Actual result: -------------- Fatal error: Interface 'A\B\C' not found in... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54327&edit=1
