Re: error on last line of file (tearing hair out)
| From: | CC Zona | Date: | Wed, 04 Apr 2001 06:03:29 +0000 |
| Subject: | Re: error on last line of file (tearing hair out) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46985@lists.php.net to get a copy of this message | ||
In article <148501c0bcad$35052e70$6501a8c0@workstation7>,
steve-lists@befriend.com ("Steve Werby") wrote:
> "Justin French" <justin@indent.com.au> wrote:
> > Problem is, line 88 is the last line of the file, which
> > simply has "</HTML>"
> > Since the last line of the file has NO PHP CODE, and all the php code
> > prior to that has been closed off (?>), or is it more likely a bug in my
> > code, but PHP4 isn't reporting the correct line?
>
> Maybe you have a missing closing bracket "}".
Some other common causes (I've been caught by 'em all <g>): using a here
doc that either has trailing whitespace on the opening line or leading
whitespace on the closing line, a missing semicolon on a last or
near-to-last line, ditto for a closing parenthesis, a non-missing bracket
or parenthesis that's turned in the wrong direction...etc. Somewhere along
there was a syntax error that didn't look like a syntax error, so the PHP
parser kept going. And going. Until it reached the last line with
something still left open. Just comment out chunks of code, working
backwards from the end, until the error goes away. Then narrow down until
you find the problem line(s).
--
CC