phpWhois.org icon indicating copy to clipboard operation
phpWhois.org copied to clipboard

php8.1 and php8.2 issues

Open tubby1981 opened this issue 2 years ago • 1 comments

I got timeouts in PHP 8.2 when searching for certain IPv6 addresses and was able to solve this


######## php 8.1 ########

Automatic conversion of false to array is deprecated in src/whois.parser.php on line 93

if ($newblock && $hasdata) { $blocks = array(); // added this in the code $blocks[$gkey] = $block; $block = array(); $gkey = ''; }

######## php 8.2 ########

Deprecated: Creation of dynamic property idna_convert::$slast is deprecated in src/whois.idna.php on line 96

class idna_convert { /** * Holds all relevant mapping tables, loaded from a seperate file on construct * See RFC3454 for details * * @var array * @access private */ public $slast; // added this in the code


With the above code changes the script works again, but there are still deprecated messages.

  • Deprecated: Creation of dynamic property Whois::$deepWhois is deprecated
  • Deprecated: Creation of dynamic property ripe_handler::$deep_whois is deprecated in src/whois.client.php on line 467
  • Warning: Undefined array key "main" insrc/whois.parser.php on line 37

tubby1981 avatar Dec 08 '23 10:12 tubby1981

Warning: Undefined array key "main" insrc/whois.parser.php on line 37

changed line 37 `from: if (empty($blocks) || !is_array($blocks['main']))

to:

if (empty($blocks) || (isset($blocks['main']) && !is_array($blocks['main'])))`

tubby1981 avatar Dec 14 '23 16:12 tubby1981