问题
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?
回答1:
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.
回答2:
PDO can be configured to throw exceptions
回答3:
PHP 5 has an exception model similar to that of other programming languages.
ErrorException
来源:https://stackoverflow.com/questions/10607539/is-there-any-native-php-function-which-throws-an-built-in-exception