Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49843 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43913 invoked from network); 3 Oct 2010 06:19:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2010 06:19:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=diogin@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=diogin@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: diogin@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:49193] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/F1-25809-08028AC4 for ; Sun, 03 Oct 2010 02:19:45 -0400 Received: by qwa26 with SMTP id 26so2596231qwa.29 for ; Sat, 02 Oct 2010 23:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=Gr7oZJ02xEJbuC2RN29FgnfBNSIUBd2cT3oxKy26r6s=; b=jtToZRICbsfIn1HsbIO5x6IGZEnnY3kPeGnK6QsUrlMTgoit53or7gteqffEkBSlvB Hb1rcv9PERbNweGmcn+EbTmFfuxf9j5VgKvsE7KsuXMlFARRZbBXnRiDEsnNM4W1/4IB arN+CBHho0kEIzyCwT4S3/rGWixJaAyuqG3QA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=amQ0Ngbyh4wXerU0EZR9Q6UZz1074RTFmZMC/HDzbQQz/PBErTSPkmb3X1yu4cgQqt 7edZqi913UWfUbnv7NqkESLvJMoK/CLuBPrtEvAHrQNbsAo6VZ7F+WNSfd/eqyPhIa3x uw3CJ5gpMFJdYn+/Yrjj6Cfn35noRSDyKzBcg= MIME-Version: 1.0 Received: by 10.229.51.219 with SMTP id e27mr5542466qcg.250.1286086782536; Sat, 02 Oct 2010 23:19:42 -0700 (PDT) Received: by 10.229.188.147 with HTTP; Sat, 2 Oct 2010 23:19:42 -0700 (PDT) In-Reply-To: <4CA81BD2.6060807@sugarcrm.com> References: <4CA81BD2.6060807@sugarcrm.com> Date: Sun, 3 Oct 2010 14:19:42 +0800 Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=0016367d595ad2cd4a0491b06993 Subject: Re: [PHP-DEV] Is this behavior expected? From: diogin@gmail.com (Jingcheng Zhang) --0016367d595ad2cd4a0491b06993 Content-Type: text/plain; charset=ISO-8859-1 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 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 > -- Best regards, Jingcheng Zhang Beijing, P.R.China --0016367d595ad2cd4a0491b06993--