Throwable::getFile » « Throwable::getMessage PHP 手册 语言参考 预定义接口和类 Throwable Throwable::getCode (PHP 7, PHP 8)Throwable::getCode — 获取异常代码 说明 public Throwable::getCode(): int 返回 thrown 对象关联的的错误号。 参数 此函数没有参数。 返回值 返回 Exception 的 int 异常代码, 但如果是 Exception 的子类,可能会使其他类型(例如,PDOException 返回的类型是 string )。 参见 Exception::getCode() - 获取异常代码 发现了问题? 了解如何改进此页面 • 提交拉取请求 • 报告一个错误 +添加备注 用户贡献的备注 此页面尚无用户贡献的备注。 备份地址:http://www.lvesu.com/blog/php/throwable.getcode.php