September 2001
Intermediate to advanced
768 pages
32h 45m
English
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 ...
Read now
Unlock full access