note 11874 deleted from features.error-handling by betz
| From: | betz@php.net | Date: | Wed, 09 Oct 2002 07:37:51 +0000 |
| Subject: | note 11874 deleted from features.error-handling by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37832@lists.php.net to get a copy of this message | ||
Default php.ini does NOT set to display E_NOTICE messages. For sevral reasons, programmers are
better to work with NOTICE messages while developing PHP application.
1) Debug: NOTICE massage will warn programmer if there are codes that are possibly bug.
For example, use of unassigned values are warned. It is extremely useful to find typo and to save
time for debug.
2) Style: NOTICE message will warn programmer if code has bad style.
For example, $arr[item] is better to be written as $arr['item'] since PHP tries to treat
"item" as constant, if it is not a constant, PHP assume it is a string index for array.
This requires a litle more CPU time.
In return of these, programmer make sure variables are always initialized before using them. This
requires a few more typing and requires a little CPU time, but it worth to do. IMHO.