#936 [NEW]: throwError() treats every call as static

From: Date: Wed, 03 Mar 2004 10:54:27 +0000
Subject: #936 [NEW]: throwError() treats every call as static
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-26053@lists.php.net to get a copy of this message
From: markus dot kalkbrenner at arcor dot de Operating system: Irrelevant PHP version: Irrelevant PHP Bug Type: Bug System Bug description: throwError() treats every call as static 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 -- Edit bug report at http://pear.php.net/bugs/bug.php?id=936&edit=1 --

« previous php.pear.dev (#26053) next »