PHP 8.5.0 Alpha 4 available for testing

Voting

: min(two, five)?
(Example: nine)

The Note You're Voting On

swannie at swannie dot net
4 years ago
Hopefully this helps someone else out because this was driving be bonkers for a good two hours. It looks like valueretrieval and enum_print work together in a way that I wasn't expecting, and after re-reading may be by design but I'm not sure. If you can't get enums to print, this might be why.

<?php
$snmp
= new SNMP(SNMP::VERSION_2C,'192.168.1.9','test');
$snmp->oid_output_format = SNMP_OID_OUTPUT_SUFFIX;
$snmp->valueretrieval = SNMP_VALUE_PLAIN;
$snmp->enum_print = 0;
echo
$snmp->get('IF-MIB::ifOperStatus.10110') . "\n";
$snmp->enum_print = 1;
echo
$snmp->get('IF-MIB::ifOperStatus.10110') . "\n";
$snmp->quick_print = 1;
echo
$snmp->get('IF-MIB::ifOperStatus.10110') . "\n";
$snmp->valueretrieval = SNMP_VALUE_LIBRARY;
echo
$snmp->get('IF-MIB::ifOperStatus.10110') . "\n";
$snmp->enum_print = 0;
echo
$snmp->get('IF-MIB::ifOperStatus.10110') . "\n";
?>

Output:
1
1
1
1
up

<< Back to user notes page

To Top