O'Reilly logo

PHP 7 Quick Scripting Reference, Second Edition by Mikael Olsson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Mikael Olsson 2016

Mikael Olsson, PHP 7 Quick Scripting Reference, 10.1007/978-1-4842-1922-5_29

29. Error Handling

Mikael Olsson

(1)Hammarland, Finland

An error is a mistake in the code that the developer needs to fix. When an error occurs in PHP, the default behavior is to display the error message in the browser. This message includes the file name, line number, and error description in order to help the developer correct the problem.

While compile and parse errors are typically easy to detect and fix, run-time errors can be harder to find because they may only occur in certain situations and for reasons beyond the developer’s control. Consider the following code that attempts to open a file for reading using the fopen function .

$handle = fopen('myfile.txt', ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required