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]
|