assert_options
mixed assert(int assert_option, [mixed value])
assert_option | Single ASSERT_* flag, such as ASSERT_ACTIVE |
value | Optional value to assign to the flag |
Changes assert() behavior.
Returns:
Original setting; FALSE on error
Description:
Changes the behavior of the assert() function. This function can be used to set options such as the warning message, terminate script processing, or add a callback function when the assertion fails.
assert() callbacks are particularly useful for building automated test suites because they allow you to easily capture the code passed to the assertion, along with information on where the assertion was made. While this information can be captured via other methods, using assertions makes it much faster ...
Get PHP Functions Essential Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.