You are here: Re: PLEASE HELP - Very odd problem « PHP Programming Language « IT news, forums, messages
Re: PLEASE HELP - Very odd problem

Posted by Jerry Stuckle on 03/06/07 11:53

Toby A Inkster wrote:
> Mike Russell wrote:
>
>> Big suggestion: consider using a debug environment - life will be much more
>> pleasant. It will take several days to set up, but I think you will find it
>> is well worth it.
>
> I considered this, but then decided the best way to avoid those long hours
> of bug hunting was to just write code that doesn't have any bugs in it. I
> don't know why I never thought of that before -- all those years of
> writing code with bugs in it and then debugging it -- much easier just not
> to write the bugs in the first place. ;-)
>
> More seriously, no matter how good you get at PHP, these silly little
> syntax errors like misplaced brackets and missing semicolons are always
> the ones that come back to bite you.
>
> If you (not you in particular, Mike; I am referring to the general "you")
> don't already have the command line version of PHP, then get it, and run
> "php -l filename" on any file before you try using it. It will catch any
> parsing errors in the file.
>
> After that, enabling PHP's normal error reporting should provide fairly
> helpful error messages, such as when you don't provide enough parameters
> for a particular function, or if you've not implemented a particular
> interface correctly, and so forth. When relevant, it tells you the exact
> file and line number where the problem is. These bugs are usually fairly
> simple to fix.
>
> Then you "only" have to deal with logic errors. :-)
>

I agree, Tony. I always keep a test server (not available to the
outside world) with all error reporting enabled. It really saves a lot
of time!

I've tried debug environments before, and they're nice. But they're
also slow and cumbersome. I haven't found one I like well other than
Zend - but I'm not going to spend the money for it as little as I need
it. echo statements work quite well.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация