Re: Re: cvs: pear-core /PEAR

From: Date: Mon, 06 Sep 2004 16:07:47 +0000
Subject: Re: Re: cvs: pear-core /PEAR
References: 1 2 3 4 5 6  Groups: php.pear.dev php.pear.core 
Request: Send a blank email to pear-dev+get-33248@lists.php.net to get a copy of this message
Sergio Carvalho wrote:
Lukas Smith wrote:
Sergio Carvalho wrote:
Hmm, I can see how this warning discussion can get really interesting. This is potentially a nice idea. If I read you correctly, you'd do something like: PEAR_Warning::allow('Some_Package_Downcast'); Some_Package_Class::method(); And then, inside the method, you'd have the regular PEAR_Warning::add. If an unallowed warning is fired, it gets automatically upgraded to an exception, right?
err, it should be the other way around!
Greg's current model is designed the other way around. I personally don't have a formed opinion on warning handling -- other than treating PHP's warnings, I really don't use them in my code and actually find the current PHP4 model more of a nuisance than an useful tool. I don't know how are warnings currently used.
Well if you make every warning an exception they will be even more of a nuisance.
but isnt this another case of where the exception backtrace will get "polluted" with non relevant data?
Here, I don't find it a big problem. The backtrace will start in PEAR_Warning::add, but that's how things happened: a Warning was fired, but since it was disallowed, it was upgraded to an exception.
Well, kinda reminds me of the PEAR_Errors gets upgraded to PEAR_Exception thing we discussed a while back in order to make it possible to support Exceptions within PHP4 compatible code. Anyways seems like the same thing to me, but I am not going to argue over it.
seems like more and more this fact is becoming a show stopper (as it already was for the turn pear_errors into exceptions on demand php4/php5 compatibility thing). maybe its time we address this?
How is it a showstopper?
Showstopper in the sense that it effectively killed off the "Exceptions within PHP4 compatible code" idea. regards, Lukas

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