Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #937 throwError() treats every call as static
Submitted: 2004-03-03 11:06 UTC
From: markus dot kalkbrenner at arcor dot de Assigned: cellog
Status: Closed Package: PEAR
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 49 - 3 = ?

 
 [2004-03-03 11:06 UTC] markus dot kalkbrenner at arcor dot de
Description: ------------ The method throwError() of class PEAR treats every call as static one because the check if $this is a subclass of PEAR_Error is always false. Here's a patch: --- PEAR_original.php 2004-02-09 10:03:10.000000000 +0100 +++ PEAR.php 2004-03-03 11:52:50.000000000 +0100 @@ -549,7 +549,7 @@ $code = null, $userinfo = null) { - if (isset($this) && is_subclass_of($this, 'PEAR_Error')) { + if (isset($this) && is_a($this, 'PEAR')) { return $this->raiseError($message, $code, null, null, $userinfo); } else { return PEAR::raiseError($message, $code, null, null, $userinfo); Note: The patch doesn't resolve the basic problem of how to detect static calls to a function / method but is compatible to the rest of PEAR.php. See http://pear.php.net/bugs/bug.php?id=744&thanks=3 Markus Kalkbrenner

Comments

 [2004-04-03 06:20 UTC] cellog
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.