August 2013
Intermediate to advanced
140 pages
1h 49m
English
CHAPTER 29
![]()
Error Handling
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 filename, 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 as 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', 'r');
It relies ...
Read now
Unlock full access