function divide($dividend, $divisor) { if ($divisor === 0) { trigger_error("Cannot divide by 0", E_USER_ERROR); } return $dividend / $divisor; } echo divide(10, 0);In this example, the `divide()` function is defined to divide two numbers. If the divisor is 0, the function raises an error using `trigger_error()`. The second argument `E_USER_ERROR` specifies the type of error raised. Package Library: This functionality is part of the PHP core, so no additional package library is required.