PHP errors and exceptions
Handle invalid entries, missing records, and interrupted work. Follow each failure from the input that triggers it to a response the user can act on.
Input and validation
- Null coalescing operatorPrint a label when the phone number is missing
- TypeErrorCheck the type of an imported fare
- checkdateCheck a delivery date entered on a form
- filter_var and FILTER_VALIDATE_INTReject a mistyped order quantity
- strlen before substrRead the depot prefix on a damaged label
State and collections
- DivisionByZeroErrorSplit an equipment fee across a class
- LogicExceptionAdd an item after checkout closes
- SplQueue::isEmptyCall the next person at the clinic
- array_key_existsFind a seat after the coach changes
Files and streams
Jobs and runtime
Handling and diagnostics
- debug_backtrace()debug_backtrace() returns an array of stack frames.
- debug_print_backtrace()debug_print_backtrace() writes the current call stack to the output.
- E_ERRORE_ERROR (1) identifies a fatal runtime error.
- E_NOTICEE_NOTICE (8) identifies a runtime notice.
- E_PARSEE_PARSE (4) identifies a syntax error detected by the parser.
- E_WARNINGE_WARNING (2) identifies a runtime warning.
- Throwable::getPreviousPreserve the original reason for an import failure