sparc / phpWhois.org

Original phpWhois soruces
http://www.phpwhois.org
GNU General Public License v2.0
95 stars 43 forks source link

Array initialization not compatible with php version less than 5.4 #22

Closed alan84mx closed 2 years ago

alan84mx commented 2 years ago

Hello, the whois.parser.php file contains two array initialization statements with syntax compatible only with PHP versions greater than or equal to 5.4, which generates the following error during execution on older PHP versions:

PHP Parse error: syntax error, unexpected '[' in /var/www/inc/phpWhois.org-master/src/whois.parser.php on line 341 PHP Parse error: syntax error, unexpected '[' in /var/www/inc/phpWhois.org-master/src/whois.parser.php on line 408

To maintain compatibility with older versions of PHP you can change the initialization of these variables from "[]" to "array()" in the following two lines:

Line 341: Current: $r = []; Suggested change: $r = array();

Line 408: Current: if (!isset($array[$key])) $array[$key] = []; Suggested change: if (!isset($array[$key])) $array[$key] = array();

sparc commented 2 years ago

fixed! thanx !