|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-02-01 10:10 UTC] andy at root dot lu
Description: ------------ The following straightforward code throws the following warning: PHP Warning: snmpget(): mailformed IPv6 address, closing square bracket missing $ip = "[2001:abc:dead:beef::22]"; $test = snmpget($ip, "mycommunity", "something"); Clearly, there is no missing closing bracket. The IPv6 address is working. Also, the warning has a typo. It should say malformed instead of mailformed :-) Test script: --------------- $ip = "[2001:abc:dead:beef::22]"; $test = snmpget($ip, "mycommunity", "something"); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
Updated to latest. Problem persists. I noticed something though: This code works (only 2 lines): $ip = "[2001:abc:dead:beef::22]"; $test = snmpget($ip, "mycommunity", "something"); This code does not work and throws the error about missing closing bracket: $ip = "[2001:abc:dead:beef::22]"; for($j=1;$j<5;$j++) { $test = snmpget($ip, "mycommunity", "something".$j); echo "Outlet $j: $test\n"; } First iteration of for loop works fine, but after second iteration it complains about malformed ipv6 address, which does not make any sense. Same issue happens if I use a while loop. OUTPUT: Outlet 1: 1 Warning: snmpget(): malformed IPv6 address, closing square bracket missing in test.php on line 9 Outlet 2: Warning: snmpget(): malformed IPv6 address, closing square bracket missing in test.php on line 9 Outlet 3: Warning: snmpget(): malformed IPv6 address, closing square bracket missing in test.php on line 9 Outlet 4: