Question

While answering PHP rename() doesn't throws exception on error I was wondering if there are any native PHP functions which throw a built-in Exception, beside the SPL stuff?

Was it helpful?

Solution

Not really. If you read the note on that page you linked:

Note:

Internal PHP functions mainly use Error reporting, only modern Object oriented extensions use exceptions. However, errors can be simply translated to exceptions with ErrorException.

OTHER TIPS

PHP 5 has an exception model similar to that of other programming languages.

ErrorException

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top