note 84760 added to function.assert
| From: | hodgman at ali dot com dot au | Date: | Tue, 29 Jul 2008 04:19:43 +0000 |
| Subject: | note 84760 added to function.assert | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-142879@lists.php.net to get a copy of this message | ||
As noted on Wikipedia - "assertions are primarily a development tool, they are often disabled
when a program is released to the public." and "Assertions should be used to document
logically impossible situations and discover programming errorsâ if the 'impossible'
occurs, then something fundamental is clearly wrong. This is distinct from error handling: most
error conditions are possible, although some may be extremely unlikely to occur in practice. Using
assertions as a general-purpose error handling mechanism is usually unwise: assertions do not allow
for graceful recovery from errors, and an assertion failure will often halt the program's
execution abruptly. Assertions also do not display a user-friendly error message."
This means that the advice given by "gk at proliberty dot com" to force assertions to be
enabled, even when they have been disabled manually, goes against best practices of only using them
as a development tool.
----
Server IP: 209.41.74.194
Probable Submitter: 203.2.182.248
----
Manual Page -- http://www.php.net/manual/en/function.assert.php
Edit -- https://master.php.net/note/edit/84760
Del: integrated -- https://master.php.net/note/delete/84760/integrated
Del: useless -- https://master.php.net/note/delete/84760/useless
Del: bad code -- https://master.php.net/note/delete/84760/bad+code
Del: spam -- https://master.php.net/note/delete/84760/spam
Del: non-english -- https://master.php.net/note/delete/84760/non-english
Del: in docs -- https://master.php.net/note/delete/84760/in+docs
Del: other reasons-- https://master.php.net/note/delete/84760
Reject -- https://master.php.net/note/reject/84760
Search -- https://master.php.net/manage/user-notes.php