PHP Errors

ConstantDescriptionHalts Script?
E_ERRORFatal runtime erroryes
E_CORE_ERRORFatal PHP startup erroryes
E_COMPILE_ERRORFatal compile-time erroryes
E_USER_ERRORFatal programmer generated error programmer defined
   
E_WARNINGNon-fatal runtime errorno
E_CORE_WARNINGNon-fatal PHP startup errorno
E_COMPILE_WARNINGNon-fatal compile-time errorno
E_USER_WARNINGNon-fatal programmer generated error programmer defined
   
E_PARSECompile-time parser erroryes
   
E_NOTICERuntime noticeno
E_USER_NOTICEProgrammer noticeprogrammer defined
   
E_ALLAll of the above 

Typically, once code is deployed, the only problems that the code needs to handle are E_WARNING, E_USER_ERROR, E_USER_WARNING and E_USER_NOTICE.

Sample Code : warning.php

Debugging Tips


Custom Error Handling

Production Error Handler Characteristics

Sample Code: error.php


Laboratory

Do something interesting and non-trivial that involves errors and error reporting. If you are a Montana State student, demonstrate it during today's lab period. If you are a University of Leipzig student, either demonstrate it during today's lab period or e-mail it to Sebastian (loewe AT uni-leipzig.de) no later than the end of the day.

Valid XHTML 1.0!