0)
E_USER_ERROR User-generated errors
E_USER_NOTICE User-generated notices
E_USER_WARNING User-generated warnings
E_WARNING Run-time warnings
CHAPTER 8 ?– ERRO R AND EXCEPTION HANDL ING 215
Introduced in PHP 5, E_STRICT suggests code changes based on the core developers??™
determinations as to proper coding methodologies and is intended to ensure
portability across PHP versions. If you use deprecated functions or syntax, use references
incorrectly, use var rather than a scope level for class fields, or introduce other
stylistic discrepancies, E_STRICT calls it to your attention. In PHP 6, E_STRICT is integrated
into E_ALL; therefore, when running PHP 6, you??™ll need to set the error_reporting
directive to E_ALL in order to view these portability suggestions.
?– Note The error_reporting directive uses the tilde character (~) to represent the logical operator NOT.
During the development stage, you??™ll likely want all errors to be reported. Therefore,
consider setting the directive like this:
error_reporting = E_ALL
However, suppose that you were only concerned about fatal run-time, parse, and
core errors. You could use logical operators to set the directive as follows:
error_reporting E_ERROR | E_PARSE | E_CORE_ERROR
As a final example, suppose you want all errors reported except for user-generated
ones:
error_reporting E_ALL & ~(E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
As is often the case, the name of the game is to remain well-informed about your
application??™s ongoing issues without becoming so inundated with information that
you quit looking at the logs.
Pages:
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292