Re: [PEPr] Comment on PHP::Assert

From: Date: Thu, 11 Aug 2005 20:20:55 +0000
Subject: Re: [PEPr] Comment on PHP::Assert
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-39331@lists.php.net to get a copy of this message
Hi together, Quoting Jesper Veggerby Hansen <pear.nosey@veggerby.dk>:
Travis Swicegood wrote:
Jesper Veggerby wrote while I was writing this reply:
... but since assert() drops a warning and returns true or false, I'd personally prefer the simple "if"-check and the exception, which you can at least catch in a try-catch (somewhere in the call-stack!) Not as assert() where you only can "catch" it at the assertion point (also with and if (and you have to use @assert()).
I think that exception-throwing and catching should not have to do anything with assertions. As mentioned before assertions should be used where normally nothing fails - but when, then there is no way of recovery ... Somehow Travis got the point when he wrote that there is the assert() function which also does a satisfactory job. But on the other hand I think it would not harm anyone if there was a PHP_Assertion wrapper around assert() in PEAR. I think people could decide on their own whether to use this or not. Carsten :)

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