Re: request for error checking feature [message #184085 is a reply to message #184048] |
Wed, 04 December 2013 20:19 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Tue, 03 Dec 2013 16:52:05 -0500, richard wrote:
> How about making it so that when you check documents for errors, ALL of
> the errors get listed in one shot!
> I'm tired of having to correct errors one by one.
> Correcting errors one at a time, uploading, and doing that a few hundred
> times is tedious, time consuming, and damn boring.
>
> And knowing more precisely what caused the error.
> e.g. ""theme song"" generates Parse error: syntax error, unexpected
> T_CONSTANT_ENCAPSED_STRING, expecting ')
>
> WTF does that mean?
> Why can't it just say "Double quotes not allowed here".
Because the error is not "double quotes not allowed here".
Double quotes, or to be more accurate a zero length string literal, is a
perfectly valid string anywhere that a string is allowed.
The error is the word theme that appears after the empty string literal.
The php interpreter does not know that you intended theme song to be a
string literal, it knows that it has a string literal (which happens to
be a zero length string) followed by unexpected words that match the form
of constant names (not being variable names or reserved words).
The interpreter will not try and guess what you wanted to do when your
syntax is broken. In addition, it stops at the first error because it
makes no sense to try and carry on processing.
If you knew what you were doing, you might try:
php -<some command line arg here> filename.php
but I'm guessing that you don't even know what the word you need to
search for to try and find which command line argument to use is.
Hint: It's on this web page:
http://www.php.net/manual/en/features.commandline.options.php
--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
|
|
|