Skip to content

Commit bb9365a

Browse files
authored
Change line mentioning assert should only be used when debugging (#4537)
The implication of only being used as a debugging tool is that it should never hit production code. This is contradicted by the line above ("but are optimised away to have zero cost in production") above and the paragraph following it which requires asserts to exist in running code to make sense. As mentioned in a comment on the php.net page (https://www.php.net/manual/en/function.assert.php#129271), `assert` sees widespread usage in code in the wild. It definitely is used outside of debugging. Instead of removing it, this changes the line to mention its relation to debugging which is relevant and otherwise absent from the article.
1 parent 2a3e48b commit bb9365a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reference/info/functions/assert.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
zero cost in production.
2121
</para>
2222
<para>
23-
Assertions should be used as a debugging feature only.
23+
Assertions can be used to aid debugging.
2424
One use case for them is to act as sanity-checks for preconditions
2525
that should always be &true; and that if they aren't upheld this indicates
2626
some programming errors.

0 commit comments

Comments
 (0)