Home » PEAR » PEAR » Bug #4196
Replace PEAR error system
Details
| Request #4196 | Replace PEAR error system |
|---|---|
| Submitted | 2005-04-21 13:06 UTC |
| From | info at adaniels dot nl |
| Status | Bogus |
| Package | PEAR |
| PHP Version | 5.0.4 |
| Roadmaps | (Not assigned) |
Comments
[2005-04-21 13:06 UTC] info at adaniels dot nl
Description:
------------
Pear currently uses a system where any given result may be an PEAR error and should be check before continueing. I believe this is quite outdated, since PHP 5 supports exceptions.
Perhaps the use of exceptions can be enabled using a setting in php.ini to maintain backward compability.
Reproduce code:
---------------
So instead of:
$result = a($b);
if ($PEAR::isError($result)) {
....
} else {
$result = g($h);
if ($PEAR::isError($result)) {
....
} else {
....
}
}
Expected result:
----------------
Much nicer would be:
try {
a($b);
g($h);
} catch (PearException $e) {
....
}
[2005-04-21 13:33 UTC] smith at backendmedia dot com
Furthermore PEAR_Error is by no means outdated. Its just an alternate more flexible, less magic error handling mechanism. You have been brainwashed.