1--TEST--
2Test SNMP object property errors
3--EXTENSIONS--
4snmp
5--SKIPIF--
6<?php
7require_once(__DIR__.'/skipif.inc');
8?>
9--FILE--
10<?php
11require_once(__DIR__.'/snmp_include.inc');
12
13$session = new SNMP(SNMP::VERSION_1, $hostname, $community, $timeout, $retries);
14
15try {
16    $session->info = [];
17} catch (Error $exception) {
18    echo $exception->getMessage() . "\n";
19}
20
21try {
22    $session->info += [];
23} catch (Error $exception) {
24    echo $exception->getMessage() . "\n";
25}
26
27try {
28    $session->max_oids = [];
29} catch (TypeError $exception) {
30    echo $exception->getMessage() . "\n";
31}
32
33try {
34    $session->max_oids = -1;
35} catch (ValueError $exception) {
36    echo $exception->getMessage() . "\n";
37}
38
39try {
40    $session->valueretrieval = [];
41} catch (TypeError $exception) {
42    echo $exception->getMessage() . "\n";
43}
44
45try {
46    $session->quick_print = [];
47} catch (TypeError $exception) {
48    echo $exception->getMessage() . "\n";
49}
50
51try {
52    $session->enum_print = [];
53} catch (TypeError $exception) {
54    echo $exception->getMessage() . "\n";
55}
56
57try {
58    $session->oid_output_format = [];
59} catch (TypeError $exception) {
60    echo $exception->getMessage() . "\n";
61}
62
63try {
64    $session->oid_increasing_check = [];
65} catch (TypeError $exception) {
66    echo $exception->getMessage() . "\n";
67}
68
69try {
70    $session->exceptions_enabled = [];
71} catch (TypeError $exception) {
72    echo $exception->getMessage() . "\n";
73}
74
75?>
76--EXPECT--
77Cannot write read-only property SNMP::$info
78Cannot write read-only property SNMP::$info
79Cannot assign array to property SNMP::$max_oids of type ?int
80SNMP::$max_oids must be greater than 0 or null
81Cannot assign array to property SNMP::$valueretrieval of type int
82Cannot assign array to property SNMP::$quick_print of type bool
83Cannot assign array to property SNMP::$enum_print of type bool
84Cannot assign array to property SNMP::$oid_output_format of type int
85Cannot assign array to property SNMP::$oid_increasing_check of type bool
86Cannot assign array to property SNMP::$exceptions_enabled of type int
87