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. | `------------------------------------------------------------' -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php