[dev] Re: [cvs] commit: horde/lib Category.php

Jan Schneider jan@horde.org
Mon, 30 Sep 2002 11:39:38 +0200


Zitat von Chuck Hagenbuch <chuck@horde.org>:

> Quoting Jan Schneider <jan@ammma.de>:
> 
> >   I guess this is more readable.
> 
> Why? Also possibly more expensive, though I haven't tested yet. Please
> revert this...

Because we use isError() everywhere in our code, it isn't (much) more
expensive and it also catches subclasses of PEAR_Error:

    function isError($data) {
        return (bool)(is_object($data) &&
                      (get_class($data) == 'pear_error' ||
                      is_subclass_of($data, 'pear_error')));
    }

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft