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

From: Date: Fri, 09 Oct 2015 19:35:32 +0000
Subject: Bug #20962 [Com]: MDB2_Error constructor is calling undefined function PEAR_Error().
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-11284@lists.php.net to get a copy of this message
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: --------------- <?php require_once('MDB2.php'); $error = new MDB2_Error('test'); echo "Hello"; Expected result: ---------------- It should print "Hello" to the console when run on the shell. Actual result: -------------- PHP Fatal error: Call to undefined method MDB2_Error::PEAR_Error() in /usr/share/php/MDB2.php on line 978 PHP Stack trace: PHP 1. {main}() /home/username/test.php:0 PHP 2. MDB2_Error->__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

« previous php.pear.bugs (#11284) next »