Re: PEAR's Error Handling and PHP5

From: Date: Wed, 07 Jun 2006 19:54:53 +0000
Subject: Re: PEAR's Error Handling and PHP5
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42839@lists.php.net to get a copy of this message
Matthew Weier O'Phinney wrote:
On 6/7/06, Pierre <pierre.php@gmail.com> wrote:
On 6/7/06, Markus Wolff <wolff@21st.de> wrote:
Justin Patrin schrieb:
Some talking points: 1) Would it be possible for us to allow both PEAR_Error and Exception usage for PHP5 packages? Would this fragment our error handling too much? (This would, of course, require a version of PEAR_Error which is E_STRICT).
In places where PHP5-packages must interoperate with PHP4 ones, there won't be another solution here. No need for an E_STRICT-compatible PEAR_Error here, as in situations dealing with PHP4 packages E_STRICT will be impossible anyway. For PHP5-packages, I'm definitely pro-Exception.
I'm defitivally and totally against forcing design choices. Exceptions usage is a design choice Understand you use them when you consider you have not because a rule foces you to use them everywhere as error handler or control flow.
Using PEAR_Error is a design choice, too, and PEAR enforced that until PHP5 came along. Can someone on-list provide some reasons *for* sticking with PEAR_Error? or some information on where exceptions *wouldn't* fit with PEAR? Reasons other than "this forces design decisions" or "exceptions are evil"? I'd like to see some real, issues-oriented debate. There are plenty of good arguments now why exceptions might be the right direction; let's see if there are some good arguments for PEAR_Error in a PHP5 world.
As a side note there is a PEAR_Exception living in CVS that has observers among other things. It was discussed to make its usage recommended for exceptions. Arnaud.

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