Re: Mail_IMAP 2.0.0 alpha 1

From: Date: Tue, 06 Jul 2004 12:31:37 +0000
Subject: Re: Mail_IMAP 2.0.0 alpha 1
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31641@lists.php.net to get a copy of this message
On Jul 6, 2004, at 2:07 PM, Hans Lellelid wrote:
Tobias Schlitt wrote:
Hi David Costa! You wrote:
just jumping into this, I don't think we should force errorStack vs exceptions in PHP 5.
We should force usage of ErrorStack, IMHO, since it's a nice successor to Error and allows handling of exceptions, too.
I disagree, Toby. I think the only thing it provides is ability to handle warnings / notices in a *stack* system. This is fine, but most packages & apps (at least in my experience) don't really use warnings/notices anyway.
this was exactly my point.
The beauty with exceptions is being able to catch & re-throw them, adding additional context information along the way. Sure, I suppose you can use errorstack to throw your exceptions for you, but why? Why not just throw them directly? You get a clearer stack trace and with the stuff that's being bolted on to PEAR_Exception you're not going to lose any functionality either. Also, last I checked ErrorStack didn't support nesting Exceptions, which IMO is crucial to that system of error handling. Stacks have their place for warning/notice management. Warnings & notices should never be handled the same way as exceptions, though. I don't think we need a single solution that is designed to do both.
I agree. I just don't use very often warnings & notices therefore my only concern was in using something else then exceptions for fatal errors. PHP 5 provides this functionality, so not using it because it might look a bit difficult to learn isn't a great point IMO :D
PEAR_ErrorStack is great for PHP4-PHP5 apps, but I don't anticipate there being very many of these given how PHP5 code isn't backwards compatible. So, let people use it for warnings - if applicable. Let others throw Exceptions.
Same here. For the record I have nothing against PEAR_ErrorStack in fact I think that Greg did a great job. I just feel that for my PHP 5 developing needs PEAR_Exception does what I need. Cheers David Costa

« previous php.pear.dev (#31641) next »