Re: debugging

From: Date: Thu, 22 Jun 2000 17:35:28 +0000
Subject: Re: debugging
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2672@lists.php.net to get a copy of this message
At 10:26 AM 6/22/00 -0700, Rasmus Lerdorf wrote:
Hello php-general, As a result of poor quality of scripting engine very much frequently error is displayed on the last line of the file instead of real places. I have found many questions on it, but has not found the answers. Whether it is possible to receive from PHP better error messages? You will see the same effect for just about any scripting language. If you miss a ) or a " somewhere in your script, the parser will parse right to the end looking for the closing bracket or quote.
Thanks Rasmus, I was not thinking :) Any missing delimiter will cause an error. I usually find that with quotes and parenthesis there is another matching delimiter a line or two below the missing delimiter. In cases like this, the parser catches the missing delimiter as soon as it encounters the messed up syntax. For Example: <? $question = "Hey, how are you doing?; $answer = "Fine, how are you";
            ^
// Error caught here ?> The parser should complain that there is a syntax error on line 3. As soon as it encountered the first quote on that line, it knows that there is a problem because there is no semicolon to end the line. hth, Zak Greant Creative Director Nucleus Information Service Inc. "A camel is a horse designed by a committee." - Alex Issigonis (Designer of the Austin Mini)

« previous php.general (#2672) next »