[PHP-DEV] Is this behavior expected?

2010-10-02 Thread Jingcheng Zhang
Hello internals, I've occurred an inconsistent problem: This works and print "foo". The result is "Fatal error: Class 'C' not found". Is this result expected? Why? -- Best regards, Jingcheng Zhang Beijing, P.R.China

Re: [PHP-DEV] Is this behavior expected?

2010-10-02 Thread Stas Malyshev
Hi! The result is "Fatal error: Class 'C' not found". Is this result expected? Yes. Define your classes before using them, or use autoloading. Why? (Highly technical details) Because C can't be early-bound on compile time due to the dependency on the interface and thus at the time of the

Re: [PHP-DEV] Is this behavior expected?

2010-10-02 Thread Jingcheng Zhang
Hi Stas, Got it. Thanks for your detailed explanation :-) 2010/10/3 Stas Malyshev > Hi! > > > The result is "Fatal error: Class 'C' not found". Is this result expected? >> > > Yes. Define your classes before using them, or use autoloading. > > Why? >> > > (Highly technical details) Because C