1--TEST-- 2Function snmp_set_oid_output_format 3--CREDITS-- 4Olivier Doucet 5--SKIPIF-- 6<?php 7require_once(__DIR__.'/skipif.inc'); 8if (!function_exists('snmp_set_oid_output_format')) die('skip This function is only available if using NET_SNMP'); 9?> 10--FILE-- 11<?php 12require_once(__DIR__.'/snmp_include.inc'); 13 14echo "Checking error handling\n"; 15try { 16 var_dump(snmp_set_oid_output_format(123)); 17} catch (\ValueError $e) { 18 echo $e->getMessage() . \PHP_EOL; 19} 20 21echo "Checking working\n"; 22var_dump(snmp_set_oid_output_format(SNMP_OID_OUTPUT_FULL)); 23var_dump(snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC)); 24?> 25--EXPECT-- 26Checking error handling 27snmp_set_oid_output_format(): Argument #1 ($format) must be an SNMP_OID_OUTPUT_* constant 28Checking working 29bool(true) 30bool(true) 31