略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SNMP::getErrno

2024-04-18

SNMP::getErrno

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

SNMP::getErrnoGet last error code

说明

public SNMP::getErrno(): int

Returns error code from last SNMP request.

参数

此函数没有参数。

返回值

Returns one of SNMP error code values described in constants chapter.

范例

示例 #1 SNMP::getErrno() example

<?php
$session 
= new SNMP(SNMP::VERSION_2c'127.0.0.1''boguscommunity');
var_dump(@$session->get('.1.3.6.1.2.1.1.1.0'));
var_dump($session->getErrno() == SNMP::ERRNO_TIMEOUT);
?>

以上例程会输出:

bool(false)
bool(true)

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/snmp.geterrno.php

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