Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21178 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40032 invoked by uid 1010); 12 Dec 2005 00:32:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 40017 invoked from network); 12 Dec 2005 00:32:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2005 00:32:47 -0000 X-Host-Fingerprint: 66.11.173.122 unknown Received: from ([66.11.173.122:38593] helo=interjinn.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 26/BE-49905-C05CC934 for ; Sun, 11 Dec 2005 19:32:12 -0500 Received: from blobule.suds (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id 4D8C11435E9; Sun, 11 Dec 2005 19:31:34 -0500 (EST) To: Bart de Boer Cc: internals@lists.php.net In-Reply-To: <439CBE1D.6020003@mediawave.nl> References: <1134339999.24194.33.camel@blobule.suds> <1134341705.24194.42.camel@blobule.suds> <439CBE1D.6020003@mediawave.nl> Content-Type: text/plain Organization: InterJinn Message-ID: <1134347498.1723.12.camel@blobule.suds> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5-4mdk Date: Sun, 11 Dec 2005 19:31:38 -0500 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Bogus bug?? From: robert@interjinn.com (Robert Cummings) On Sun, 2005-12-11 at 19:02, Bart de Boer wrote: > Robert Cummings wrote: > > On Sun, 2005-12-11 at 17:26, Robert Cummings wrote: > > > > Could someone explain to my feeble mind how the bug reported at the > > following link is bogus? The added comment is pretty obtuse :( > > > > http://bugs.php.net/bug.php?id=35634&edit=2 > > > > It looks like each time your errorHandler function is called it is > trying to (re)declaring ErrorClass, causing the error. If you take > require_once('errorClass.php'); out of the errorHandler function, it > works as expected. This sample on the bug report is actually a very whittled down version of where I first experienced the problem. In practice my error class is loaded on first error and subsequently acts as a singleton. My thoughts on the problem are that PHP encounters an E_STRICT exception in testClass.php during the parse, so it invokes the error handler, the error handler then loads the error class, but because the error itself occured during the parsing of a class PHP still thinks it's parsing the class and so when errorClass.php is parsed it fires the fatal error for class nesting. IMHO that's a parser bug since PHP should (as it normally does) consider an included/required class description to be outside the the inclusion scope. As an FYI, the reason i use this technique is because my framework uses a registry type system for modular system services that are lazy loaded, one of which is the exception service. I guess I missed this problem in earlier versions of PHP5 because I filter out E_STRICT notices in the wrapper function that I refuse to correct in my engine for PHP4 compatibility reasons (I currently filter 3). But it raises the issue that anytime a new E_STRICT type error is created that I may not have addressed yet, the result is a fatal error instead of an annoying E_STRICT :) Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'