Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parse error

Status
Not open for further replies.

thumbelina

Programmer
Jun 4, 2001
58
CA
can someone please tell me what a parse error is, that way maybe I can figure out more of these problems by myself.
 
It means you've typed a command wrong, or your are missing a quote, bracket or similar off the link. Basically the syntax of that line has a mistake in it.

Check also you have not missed a semi-colon off the line it's moaning about and the line above.

This is a simple answer though. Jace Hayman
jace@swig-online.co.uk
 
The PHP debugger is pretty good at telling you what is wrong with your PHP script. Sometimes they might be ambiguous, but the debugger is pretty good at giving you the right info.

If you think about it, when you invoke the PHP Interpreter (or Parser), it calls the PHP script and parses it (breaks it up into managable pieces) and then decides what to do with it.

Since PHP code does not have to be compiled before you run it, php is called a parser because it does it on the spot.

Thats where the name parse error came from.

If you were using a lanugage like C/C++ that has to be compiled, then when you are compiling it, and something goes wrong and compiler complains, that is called a compile error.

Hope this helps.

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
Hi. I'm fairly new to PHP, and still get parse errors frequently. My experience is that if you get a parse error with no description and a line number that actually contains code, you either
a.) left out a semicolon on the line above (or a couple lines above),
b.) have one too many closing parens (braces, etc), or
c.) forgot to escape (using \) a quote in a print (echo) statement.

On the other hand, if the line number is the last line of the script, you opened something (quotes, parens, etc) and didn't close them. Happy hunting!

I tend to disagree with the above (insofar as I've experienced any of these problems)--I think PHP's error-reporting leaves a bit to be desired, although I'm coming from a Perl background and am used to being told stuff like "may be a runaway ' starting on line xx". Brad Gunsalus
Cymtec Systems, Inc.
bgunsalus@cymtec.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top