PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » PEAR » PEAR » Bug #964

PEAR_ERROR_EXCEPTION causes fatal error

Details

Submitted2004-03-07 22:54 UTC
Frommarthom at nortelnetworks dot com
Assignedcellog
StatusClosed
PackagePEAR
PHP Version5.0.0b4 (beta4)
Roadmaps(Not assigned)

Comments

[2004-03-07 22:54 UTC] marthom at nortelnetworks dot com

Description:
------------
PEAR_ERROR_EXCEPTION mode doesn't work, because PEAR_Error doesn't extend Exception.

Reproduce code:
---------------
require_once("PEAR.php");
PEAR::setErrorHandling(PEAR_ERROR_EXCEPTION);
PEAR::raiseError("Hello World!");

Expected result:
----------------
The PEAR_Error class should be thrown as an exception.

Actual result:
--------------
[08-Mar-2004 09:50:26] PHP Fatal error: Exceptions must valid objects that are derived from class Exception in /usr/local/lib/php/PEAR.php(778) : eval()'d code on line 1

[2004-03-07 23:00 UTC] marthom at nortelnetworks dot com

The OS makes no difference of course.