php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61981 OO API, walk: $suffix_as_key is not working correctly
Submitted: 2012-05-09 11:10 UTC Modified: 2013-12-06 11:52 UTC
Votes:4
Avg. Score:3.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: gubin dot gm at yandex dot ru Assigned: lytboris (profile)
Status: Closed Package: SNMP related
PHP Version: 5.4.3 OS: *
Private report: No CVE-ID: None
 [2012-05-09 11:10 UTC] gubin dot gm at yandex dot ru
Description:
------------
Bag in method SNMP::walk.
The parameter $suffix_as_key not working correctly.

Test script:
---------------
<?php
  $session = new SNMP(SNMP::VERSION_2c, "127.0.0.1", "public");
  $ifDescr = $session->walk(".1.3.6.1.2.1.2.2.1.2", TRUE);
  print_r($ifDescr);
?>

Expected result:
----------------
Array
(
    [1001] => Port 1:1
    [1002] => Port 1:2
    [1003] => Port 1:3
...
)

Actual result:
--------------
Array
(
    [1001] => Port 1:1
    [iso.3.6.1.2.1.2.2.1.2.1002] => Port 1:2
    [iso.3.6.1.2.1.2.2.1.2.1003] => Port 1:3
...
)

Patches

snmp.c.patch (last revision 2013-03-13 20:08 UTC by lvgb at sina dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-17 15:09 UTC] [email protected]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: lytboris
 [2013-03-17 16:28 UTC] [email protected]
-Summary: php5-snmp 5.4.0-3 +Summary: OO API, walk: $suffix_as_key is not working correctly -Operating System: Debian 6.0 +Operating System: *
 [2013-03-17 16:53 UTC] [email protected]
-Status: Assigned +Status: Closed
 [2013-03-17 16:58 UTC] [email protected]
-Status: Closed +Status: Feedback
 [2013-09-13 05:44 UTC] [email protected]
-Status: Feedback +Status: No Feedback
 [2013-09-13 05:44 UTC] [email protected]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


 [2013-12-06 11:37 UTC] temnota dot am at gmail dot com
tested on php 5.4.4 - works.

without patch:

Array
(
    [1] => D-Link DES-3010G R4.30.B20 Port 1
    [iso.3.6.1.2.1.2.2.1.2.2] => D-Link DES-3010G R4.30.B20 Port 2
    [iso.3.6.1.2.1.2.2.1.2.3] => D-Link DES-3010G R4.30.B20 Port 3
    [iso.3.6.1.2.1.2.2.1.2.4] => D-Link DES-3010G R4.30.B20 Port 4
    [iso.3.6.1.2.1.2.2.1.2.5] => D-Link DES-3010G R4.30.B20 Port 5
    [iso.3.6.1.2.1.2.2.1.2.6] => D-Link DES-3010G R4.30.B20 Port 6
    [iso.3.6.1.2.1.2.2.1.2.7] => D-Link DES-3010G R4.30.B20 Port 7
    [iso.3.6.1.2.1.2.2.1.2.8] => D-Link DES-3010G R4.30.B20 Port 8
    [iso.3.6.1.2.1.2.2.1.2.9] => D-Link DES-3010G R4.30.B20 Port 9
    [iso.3.6.1.2.1.2.2.1.2.10] => D-Link DES-3010G R4.30.B20 Port 10
)

with patch:
Array
(
    [1] => D-Link DES-3010G R4.30.B20 Port 1
    [2] => D-Link DES-3010G R4.30.B20 Port 2
    [3] => D-Link DES-3010G R4.30.B20 Port 3
    [4] => D-Link DES-3010G R4.30.B20 Port 4
    [5] => D-Link DES-3010G R4.30.B20 Port 5
    [6] => D-Link DES-3010G R4.30.B20 Port 6
    [7] => D-Link DES-3010G R4.30.B20 Port 7
    [8] => D-Link DES-3010G R4.30.B20 Port 8
    [9] => D-Link DES-3010G R4.30.B20 Port 9
    [10] => D-Link DES-3010G R4.30.B20 Port 10
)

Push patch to main tree.
 [2013-12-06 11:52 UTC] [email protected]
-Status: No Feedback +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 31 03:00:01 2025 UTC