You are here: Re: Returning NULL vs. returning FALSE « PHP Programming Language « IT news, forums, messages
Re: Returning NULL vs. returning FALSE

Posted by Thomas Mlynarczyk on 11/01/29 11:32

Also sprach Umberto Salsi:

> IMHO, the FALSE value as an error indicator is a practice that date
> from the PHP 3 era, when the NULL value was not available.

That sounds plausible indeed.

> But instead to encode the error inside the returned value, there are
> better solutions:
> * using PHP 5 exceptions;
> * writing your error handling function that sets a global flag

It depends on the error. If the script does not depend upon a successful
completion of a particular function, then it would be simpler to just return
an indicating value.

Greetings,
Thomas

 

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

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