Re: Gawd I hate those useless error messages...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2004-10-29 at 16:28 +0200, -{ Rene Brehmer }- wrote:
> Hi gang
> 
> I do realise that this error means I've forgotten a curly brace or 
> semi-colon somewhere, but seriously ...
> 
> Parse error: parse error, unexpected $end in E:\web\Metalbunny\addguest.php 
> on line 274
> 
> where line 274 would be the last line, obviously (since it's always the 
> last line when it does this)...
> 
> now I'm lucky that this script in question has alot of HTML in it, so 
> there's only about 180 lines of actual code, but is there really not 
> something that can be done to PHP to make errors like these just a LITTLE 
> easier to debug ???
> 
> It's not that bad in this particular case ... but when we have scripts of 
> 500-800 lines code, or even more, it tends to be a rather not very helpful 
> message... and it gets worse when you jump in and out of PHP ...
> 
> the '$end' and the '$' error are by far the most annoying errors, so hard 
> to debug ... atleast with 'unexpected {' you have a slight chance as it 
> limits the part you have to search through ...
> 
> since this is the test-server, I run with all errors, alerts, and messages 
> on, but isn't there someway to make PHP just a little more helpful when 
> this happens ???
> 
> 

Yeah, don't make errors in your code. ;-)

Also, try to seperate your html and php code as much as possible. Use a
template system of some form. (ie. smarty)

Use a PHP editor with syntax highlighting..click on one curly brace and
then find where the other highlighted brace is and make sure that it
where it should end.

Learn how to debug your code. See how far it's getting for each
thing..add test messages and die() in different scopes of code.

Good luck,

Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | robby@xxxxxxxxxxxxxxx
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*    --- Now supporting PHP5 ---
****************************************/

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux