略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Throwable::getCode

2024-04-28

Throwable::getCode

(PHP 7, PHP 8)

Throwable::getCode获取异常代码

说明

public Throwable::getCode(): int

返回 thrown 对象关联的的错误号。

参数

此函数没有参数。

返回值

返回 Exceptionint 异常代码, 但如果是 Exception 的子类,可能会使其他类型(例如,PDOException 返回的类型是 string )。

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/throwable.getcode.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3