Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

errore se il valore restituito è false

6 views
Skip to first unread message

alex

unread,
Dec 9, 2020, 3:49:44 AM12/9/20
to
if (!rewind($stream)) {
trigger_error(
"Operazione fallita",
E_USER_ERROR
);
}

Però al posto dell'errore potrei lanciare un'eccezione?
Di che tipo?

throw new Exception; // troppo generica?
throw new InvalidArgumentException; // forse non è addatta
throw new UnexpectedValueException; // forse andrebbe bene... forse...
throw new Error; // forse andrebbe bene... forse...

Cosa ne pensate?
0 new messages