Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49842 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41026 invoked from network); 3 Oct 2010 05:59:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2010 05:59:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.133 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.133 smtp133.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.133] ([67.192.241.133:54427] helo=smtp133.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/A1-25809-5DB18AC4 for ; Sun, 03 Oct 2010 01:59:51 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp23.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 924D72F8245; Sun, 3 Oct 2010 01:59:47 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp23.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 37DC12F8243; Sun, 3 Oct 2010 01:59:47 -0400 (EDT) Message-ID: <4CA81BD2.6060807@sugarcrm.com> Date: Sat, 02 Oct 2010 22:59:46 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Jingcheng Zhang CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Is this behavior expected? From: smalyshev@sugarcrm.com (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 call it's not defined, because the definition happens at run-time when control arrives to the point of class definition. Since early binding is quite complex, it is best to assume classes always are defined at run-time and define them before use. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227