Re: Assertions

From: Date: Thu, 17 Oct 2013 16:12:01 +0000
Subject: Re: Assertions
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-69640@lists.php.net to get a copy of this message
On Thu, Oct 17, 2013 at 6:06 PM, J David <j.david.lists@gmail.com> wrote: > > PHPUnit will catch the exception and tell you that an assertion failed, > but it will still be able to continue running the rest of the testsuite. > > A framework (or front controller in general) can easily catch the > exception at the top level and display an appropriate debugging page > (rather than doing ugly register_shutdown_function hacks that are necessary > to have even remotely graceful handling of fatals). > > A deamon or server will be able to process further requests, even if one > particular had an assertion failure. > > Those are three great examples of how assertions are frequently misused. > I would greatly appreciate a more detailed explanation as to how these examples abuse assertions. In particular the first two seem very reasonable to me, but I'm open to being convinced otherwise. Nikita

« previous php.internals (#69640) next »