summaryrefslogtreecommitdiff
path: root/CODING_STANDARDS
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-03-19 09:13:45 (GMT)
committerYasuo Ohgaki <yohgaki@php.net>2002-03-19 09:13:45 (GMT)
commit69d6f1e3f57a9eef9904f9bb297d7e7b7cc06c33 (patch)
tree3b928678a326e3a330940fcfcb7bda35493380cf /CODING_STANDARDS
parent239a05eef6fde444f2186b5594a9f83b8a9290f7 (diff)
downloadphp-69d6f1e3f57a9eef9904f9bb297d7e7b7cc06c33.tar.gz
Added README.SUBMITTING_PATCH file. Please fix/add/change.
Added more description for use of assert().
Diffstat (limited to 'CODING_STANDARDS')
-rw-r--r--CODING_STANDARDS7
1 files changed, 7 insertions, 0 deletions
diff --git a/CODING_STANDARDS b/CODING_STANDARDS
index 55f4026..848b4ef 100644
--- a/CODING_STANDARDS
+++ b/CODING_STANDARDS
@@ -66,6 +66,13 @@ Exceptions:
[8] Use assert(). assert.h is included in php.h if it is available. Not only
does good assertion catch bugs, but it also helps with code readability.
+ - Do not use assert for error handling. Use assert only for the
+ condition that must be always true.
+ - Do not use assignments in assert conditions. If you assign inside an
+ assert condition, you risk an elusive bug that would be very difficult
+ to spot in a debug build, due to the side effect of the assignment.
+ Function calls in assert conditions may also cause this problem, if
+ they modify one of their arguments or global variables.
Naming Conventions
------------------