Reply to Re: Returning NULL vs. returning FALSE

Your name:

Reply:


Posted by Thomas Mlynarczyk on 11/03/97 11:32

Also sprach Dikkie Dik:

> What do you WANT your function to return? If (presuming PHP5 here)
> there is a real error and the function cannot reasoable be expected
> to return anything, throw an exception.

In that case, yes.

> It COULD also be that you want your function to return a default (a
> NULL object).

In that case the function would always return a valid result, hence no need
for a special return value indicating an error. In other words: the function
would fix the error by itself.

What I'm looking for is the best suited general return value for cases where
an operation could not be successfully completed as expected and the
function is not able to fix the error by itself and the error is of a nature
where "drastic measures" like throwing an error or an exception would be
inappropriate.

Greetings,
Thomas

[Back to original 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

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