From:  pear-qa@lists.php.net ("justin.rebelo@gmail.com")
Date:  10 Oct 2015 03:35:32 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #20962 [Com]: MDB2_Error constructor is calling undefined function PEAR_Error().

NNTP-Posting-Host:  null

Edit report at https://pear.php.net/bugs/bug.php?id=20962&edit=1

 ID:               20962
 Comment by:       justin.rebelo@gmail.com
 Reported By:      justin dot rebelo at gmail dot com
 Summary:          MDB2_Error constructor is calling undefined function
                    PEAR_Error().
 Status:           Open
 Type:             Bug
 Package:          MDB2
 Operating System: Debian linux
 Package Version:  2.5.0b5
 PHP Version:      5.6.13
 Roadmap Versions: 
 New Comment:

I think the simple and hopefullly correct fix here is to replace the
$this->PEAR_Error() call with parent::__construct(). I am not sure on
exactly how patches are meant to be formatted for submission, though.


Previous Comments:
------------------------------------------------------------------------

[2015-10-09 20:01:47] jrebelo

Description:
------------
File: MDB2.php. Line: 978.
$this->PEAR_Error() is an invalid call because PEAR.php has been
upgraded and the PEAR_Error class now defines the ::__construct()
constructor instead of ::PEAR_Error() constructor. If MDB2 tries to
throw an MDB2_Error, this causes a fatal php error:

 Call to undefined method MDB2_Error::PEAR_Error() in
/usr/share/php/MDB2.php on line 978

Test script:
---------------
__construct() /home/username/test.php:3

Fatal error: Call to undefined method MDB2_Error::PEAR_Error() in
/usr/share/php/MDB2.php on line 978

Call Stack:
    0.0003     222376   1. {main}() /home/username/test.php:0
    0.0088    1004416   2. MDB2_Error->__construct()
/home/username/test.php:3

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20962&edit=1