Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<SNMP::getSNMP::getError>
^SNMPLast updated: Mon, 26 Oct 2026

SNMP::getErrno

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

SNMP::getErrno — Get last error code

Description

public function SNMP::getErrno(): int

Returns error code from last SNMP request.

Parameters

This function has no parameters.

Return Values

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

Examples

Example #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);
?>

The above example will output:

bool(false)
bool(true)

See Also


<SNMP::getSNMP::getError>
^SNMPLast updated: Mon, 26 Oct 2026