473,289 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

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

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
8 46144
> Is there an easy way to determine where the inital " started?

Try some syntax-highlighting editor.
Apr 7 '06 #2
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
vim does a pretty good job... but that is just because I am already
familiar with vi.

Apr 7 '06 #4
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
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
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
Thank you very much! The visual brace matching made it incredibly easy
to find my mistake

Apr 7 '06 #8
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Janwillem Borleffs | last post by:
Q: I'm getting an unexpected $ or $end parse/syntax error, what's causing this? A: This is caused when an expression is started with an opening brace, but the closing brace is omitted. ...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
4
mikeinspain
by: mikeinspain | last post by:
Keep getting this error! Parse error: syntax error, unexpected $end in /home/9144/domains/cbweb.co.uk/html/faq_finance.php on line 139 PHP Below.. Script was working 1 minute and copied the...
5
praclarush
by: praclarush | last post by:
I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in...
9
by: ajd335 | last post by:
Hi all... I am getting an error Parse error: syntax error, unexpected $end in http:/..... on line 117...(117 is the EOF).. can you plz help me out..I have checked out for the < , > ,{ ,} etc.......
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
9
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on...
11
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition:...
10
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.