Skip to content
Advertisement

Tag: error-handling

PHP 7 inconsistently throwing errors for division by zero

I am currently trying to understand the behavior of the new error handling in PHP 7. In the PHP Documentation for DivisionByZeroError, it states: DivisionByZeroError is thrown when an attempt is made to divide a number by zero. Fair enough, but it does not throw the DivisionByZeroError when the / operator is used. In this example, I would expect both

PHP hide fatal error message and redirect

If the following code returns a fatal error, I get a message on the page I don’t want users to see. I want to hide the fatal error message and redirect the user to another page: To hide the error message, I just added: But how do I catch and redirect a fatal error like this? Answer Basicaly, you can’t

redirecting to another page through php if error is Occurred?

i have to check weather the page is having error,if error is there i have to redirect to one default page like error.php I have tried with the following link but i cannot get the result changes in my .htaccess my errors.php code suggest me any idea,Thanks in advance.. Answer Are you working on a local server/localhost? /errors.php will refer

How do I ensure I caught all errors from MySQLi::multi_query?

The docs for multi_query say: Returns FALSE if the first statement failed. To retrieve subsequent errors from other statements you have to call mysqli_next_result() first. The docs for next_result say: Returns TRUE on success or FALSE on failure. Finally, the example posted in the docs for multi_query use the return value from next_result to determine when there are no more

PHP error_log errors to MySQL

In a previous ticket i asked about logging PHP errors in MySQL which gives me: I can make this work but only if it is triggerred like this: However, I also want the error handler to be called for all errors such as syntax errors like: But these errors are just outputted to the screen, what am i doing wrong?

Advertisement