423,850 Members | 1,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,850 IT Pros & Developers. It's quick & easy.

Parse error: syntax error, unexpected $end in ... Question/Suggestion

P: n/a
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.

Is there an easy way to determine where the inital " started? I find
myself adding /* */ blocks or cutting/pasting sections of code out in
order to find where the error occured.

Wouldn't it it be nice if the warning message included the line in teh
source where the initial quote occured?

for example say this is my code
<?
function Build_Query(....)
code...

$my_query = "SELECT BLAH FROM ; (line 15)

more code...

} (line 100)
EOF

and you got

Parse error: syntax error, unexpected $end in MYFILE on line 100
started on line 15

Just a thought
Eric

Apr 7 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
> Is there an easy way to determine where the inital " started?

Try some syntax-highlighting editor.
Apr 7 '06 #2

P: n/a
Can you suggest one?

I use notepad for all my php coding and while I can google for one I'd
like to know what other people use and why

Thanks
Eric

Apr 7 '06 #3

P: n/a
vim does a pretty good job... but that is just because I am already
familiar with vi.

Apr 7 '06 #4

P: n/a
Message-ID: <11*********************@i40g2000cwc.googlegroups. com> from
Wescotte contained the following:
I use notepad for all my php coding


For a very easy to use Notepad replacement try notepad2
http://www.flos-freeware.ch/notepad2.html

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Apr 7 '06 #5

P: n/a
Wescotte wrote:
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.


A missed end brace "}", bracket "]", or parenthesis ")" can also cause
the unexpected $end in a script as well.

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Apr 7 '06 #6

P: n/a
Wescotte wrote:
Can you suggest one?

I use notepad for all my php coding and while I can google for one I'd
like to know what other people use and why

Thanks
Eric


I'm a Linux user and mostly work in Quanta (part of KDE) and Vim, but my
friends using Windows like PSPad or phpEditorIDE. PSPad is free, for
phpEditorIDE exists at least trial version (if it is not free too - I'm
not sure).
Apr 7 '06 #7

P: n/a
Thank you very much! The visual brace matching made it incredibly easy
to find my mistake

Apr 7 '06 #8

P: n/a
Message-ID: <11**********************@v46g2000cwv.googlegroups .com> from
Wescotte contained the following:
Thank you very much! The visual brace matching made it incredibly easy
to find my mistake

Yes that's a great feature. :-)
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Apr 7 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.