wacky object idea
| From: | Chuck Hagenbuch | Date: | Mon, 28 Aug 2000 03:27:15 +0000 |
| Subject: | wacky object idea | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30898@lists.php.net to get a copy of this message | ||
How hard would it be to add a special toBoolean() method to objects, such
that if you defined that method, the result would be used as the value of
the object in a comparison.
This would let us define PEAR_Exception and friends to return false, letting
you just do if ($obj->method()) and rely on an exception to trip failure...
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
--
"You see this steel-toed work boot? It is NOT CUTE!" - Julia