2 ms·
Not that I disagree, but PHP only got exceptions relatively recently. The built-in functions existed long before that. Without exceptions, the options for error
by Zak 14y ago
Not that I disagree, but PHP only got exceptions relatively recently. The built-in functions existed long before that. Without exceptions, the options for error handling are to return an error value or exit, writing an error message somewhere. Null seems like an appropriate error value for "you asked for some data formatted as a string, and for whatever reason, I couldn't provide it".