【发布时间】:2012-05-23 08:47:37
【问题描述】:
在回答 PHP rename() doesn't throws exception on error 时,我想知道除了 SPL 之外,是否有任何原生 PHP 函数会抛出内置的 Exception?
【问题讨论】:
在回答 PHP rename() doesn't throws exception on error 时,我想知道除了 SPL 之外,是否有任何原生 PHP 函数会抛出内置的 Exception?
【问题讨论】:
【讨论】:
zend_throw_exception 表明只有在 OO 上下文中。
不是真的。如果您阅读了您链接的页面上的注释:
注意:
内部 PHP 函数主要使用 Error reporting,只有现代的 Object oriented 扩展使用异常。但是,错误可以通过ErrorException 简单地转换为异常。
【讨论】:
PHP 5 具有类似于其他编程语言的异常模型。
【讨论】: