Re: Big problem with DB::isError!

From: Date: Mon, 18 Aug 2003 12:16:49 +0000
Subject: Re: Big problem with DB::isError!
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19975@lists.php.net to get a copy of this message
On Mon, Aug 18, 2003 at 02:10:38PM +0200, nicos@php.net wrote: > Hello, > > It looks in every part of the code we use, if(DB::isError($res). But in > fact isError returns FALSE in case of error so we should use !DB::isError or > just change the behaviour of isError ? Very easy to verify it with the bug > #25003... > > Very urgent, need feedback ! > #25003. function isError($value) { return (is_object($value) && (get_class($value) == 'db_error' || is_subclass_of($value, 'db_error'))); } Read: This function returns true if and only if The parameter is an object AND the object is of the class DB_Error OR the object's class is derived from DB_Error Just as you would think... and it works here. -- Regards, Stefan Walk <swalk@prp.physik.tu-darmstadt.de>

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