u1735067 / php-snmp

Automatically exported from code.google.com/p/php-snmp
1 stars 0 forks source link

Backward compatibility issue? #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. php SNMP.php
2. use PHP/4.3.11
3.

What is the expected output? What do you see instead?
back to prompt ( I think ) when it works properly.  I am currently
recieving this error:

PHP Parse error:  parse error, unexpected T_STRING, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in
/var/www/html/snmp_monitor/SNMP4.php on line 30

Line 30:
public static function trap($ip, $varBinds=null, $community='public')

Can this code not be used on this old of a version of PHP?

What version of the product are you using? On what operating system?
Centos 4

Please provide any additional information below.

Original issue reported on code.google.com by guyve...@gmail.com on 4 Oct 2009 at 8:42

GoogleCodeExporter commented 9 years ago
NOTE
Right now due to many work I don't have much time to make changes and fix bugs.
If some-one wants to, mail me and I'll give you access to sources

Original comment by T.Kalapun on 11 Nov 2009 at 9:22

GoogleCodeExporter commented 9 years ago
the class was written using PHP5
I wasn't planning using it on php4

Original comment by T.Kalapun on 11 Nov 2009 at 9:25

GoogleCodeExporter commented 9 years ago
I ran across this issue as well in php 4.x (had to use it due to project 
constraints). To fix this, convert the file into a flat function file (remove 
the class declaration and class specific prefixes from the functions, then do a 
find/replace on everything 'self::' and replace it with a null value.). 
Finally, in your file that calls the class/function, remove the class call so 
it just reads "trap" and your params. It will then work fine.

Original comment by dorlow...@gmail.com on 30 Sep 2014 at 2:29