Re: Odd Code Error.
| From: | John W. Holmes | Date: | Thu, 22 Jan 2004 02:46:21 +0000 |
| Subject: | Re: Odd Code Error. | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175387@lists.php.net to get a copy of this message | ||
Chris W wrote:
$Key = "xyz"; lots more code here. if($key == "xyz"){Notice: Undefined variable: key in \path\to\test.php on line X
do this stuff; } lots more code here;
If the language forces variable deceleration you simply get an error "variable $key not defined on line x" then there is no searching no wondering, you immediately know you made a typo, and you know exactly what line it is on.Like that, you mean? error_reporting(E_ALL) does that for you. Of course you then turn it down when your code goes into production, though. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com