Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56285 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37382 invoked from network); 11 Nov 2011 19:37:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2011 19:37:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:63127] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/55-09898-1997DBE4 for ; Fri, 11 Nov 2011 14:37:54 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 6498E5DD2; Fri, 11 Nov 2011 14:37:51 -0500 (EST) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a69B2yO49SvZ; Fri, 11 Nov 2011 14:37:50 -0500 (EST) Received: from djbondc (modemcable166.116-70-69.static.videotron.ca [69.70.116.166]) by mail.ca.gdesolutions.com (Postfix) with ESMTPSA id 6C51F5DD1; Fri, 11 Nov 2011 14:37:50 -0500 (EST) To: "'Stas Malyshev'" , Cc: "'PHP Internals'" References: <4EBCAF14.4030100@sugarcrm.com> In-Reply-To: <4EBCAF14.4030100@sugarcrm.com> Date: Fri, 11 Nov 2011 14:37:49 -0500 Message-ID: <00a401cca0a9$65e22b60$31a68220$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcygMMyy4kXJevLOTK2BLM5wFKmBxgAdm2Bw Content-Language: en-ca Subject: RE: [PHP-DEV] Re: SPLClassLoader RFC Thoughts And Improvements From: jbondc@openmv.com ("Jonathan Bond-Caron") On Fri Nov 11 12:13 AM, Stas Malyshev wrote: >=20 > > - MODE_DEBUG: This one can work together with the other two,=20 > > allowing a validation of class/interface/trait presence in the file. > Basically, > > it requires the file and then checks if the item exists in scope. >=20 > Not sure debug adds much here - if the class is not found, you'll be=20 > notified by the engine anyway, so what's the added value? >=20 Right there will be fatal by engine anyway "Class does exist.." Our approach with autoloading has been the following: spl_autoload_register('MV_Autoload');=20 function MV_Autoload($className) { try { MV_Loader::classImport($className); } catch(MV_ClassNotFound_Exception $e) {} } It seems very wrong to me to generate a fatal error on class_exists() & = al. That's unless the spl_autoload_register() api changes and allows to deal = with errors - require(), Exception, ...