You are here: Re: Is PHP more tolerant of errors? « All PHP « IT news, forums, messages
Re: Is PHP more tolerant of errors?

Posted by Rauch Christian on 12/18/05 12:02

Curtis schrieb:
> I'm used to working with a strongly-typed language, Object
> Pascal, so just plopping a $variable down anywhere takes
> some getting used to--particularly when one instance gets
> misspelled like $varaible, say.
>
> Hmmm... seems this code was working only a minute ago!
>
> One surprise is PHP's apparent tolerance of referencing
> array elements that don't exist. Object Pascal would burp in
> a hurry.
>
> Say I go
>
> $parts = explode("|", "x | y | z");
>
> PHP doesn't seem to mind if I tell it
>
> $text = $parts[3].$parts[4];
>
> Is this looseness OK, or is gonna bite us someday?
>

You might wanna take a look at http://de3.php.net/error_reporting.

Set the error level in your script to E_ALL via the following command:

error_reporting(E_ALL);

You will see, that PHP issues a Warning.

Regards,
Rauch Christian

 

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

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