2
new A;
class A {}
new C;
class C extends A {}
new B;
class B implements iB {}
interface iB {} // we can even put interface definition after the class
// that implements it
我希望这个代码没有错误工作,而我越来越声明仅适用,如果类没有实现接口
PHP Fatal error: Class 'B' not found in ...
有人能解释为什么出现这种情况?它是一个记录的行为?
PS:PHP 5.3.2
PPS:对ideone相同的行为:http://ideone.com/q4cT6A
一切* *预期应以某种方式记录;-) – zerkms
做........... :) – hek2mgl
“如果一个类继承另一个,那么父类必须在子类结构之前声明“---并且这种行为*更奇怪*:http://ideone.com/ZDx0O7 – zerkms