Is there any native PHP function which throws an built-in Exception?

江枫思渺然 提交于 2019-11-30 02:41:46

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!