> I've been playing with the php syntax check that is called from the
> command line (via the script linked above) and it usually gets the
> line number wrong. Sometimes high, sometimes low. I think that
> comments, or perhaps lines without a ";" confuse it.
Indeed, it sometimes seems off but it makes sense if you know how the
PHP parser works.
For example, if you have this code:
<?php
if ($something) {
do_something();
} else {
do_something_else();
}
?>
And you delete the brace from the first line, you'll see that the
error is reported as being on line 6 though you might consider the
error to be on line 2. There isn't an error on line two because in
some circumstances you don't need braces after an if statement. The
parsing error happens on line 6 because that right closing brace is
not valid if there isn't a left opening brace before it. You'll see
similar issues where it's valid to omit semicolons.
Hope that helps,
-Paul Burney
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or
confirmed) problem with the software, please email to "[email protected]"
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---