|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11294 Incorrect results returned on error
Submitted: 2001-06-05 14:36 UTC Modified: 2001-06-06 01:15 UTC
From: richarde at eskom dot co dot za Assigned:
Status: Closed Package: SNMP related
PHP Version: 4.0.4pl1 OS: Linux Redhat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 - 3 = ?
Subscribe to this entry?

 [2001-06-05 14:36 UTC] richarde at eskom dot co dot za
Simple code like the code below generates ugly messages in the php code if the host has an error or is unable to connect for some reason:

$networks = snmpwalk('', 'public', ".");

These types of errors are shown:

Warning: No Response from 147.110.52.xx in /home/httpd/html/iptrack/test.php3 on line 20

This is in contradiction to what it states in the manual:

array snmpwalk (string hostname, string community, string object_id [, int timeout [, int retries]])
Returns an array of SNMP object values starting from the object_id() as root and false on error.

I think all the snmp functions have the same problems.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-06 01:15 UTC]
This is not a bug. This is how all PHP functions
behave in case of errors. You can set many error
reporting directives in php.ini which control
how the errors are reported. Or you can use @ in front
of function which will make it not to print out any errors:

$networks = @snmpwalk('', 'public', ".");

Manual is your friend, read it sometimes.. :)


PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 19:01:28 2024 UTC