io-developer / php-whois

PHP WHOIS provides parsed and raw whois lookup of domains and ASN routes. PHP 8.0 compatible (5.4+ old versions)
MIT License
438 stars 117 forks source link

Notice: Array to string conversion #127

Closed smkbd closed 3 years ago

smkbd commented 4 years ago

PHP-Whois version: 4.0.0

PHP version: 7.4.4

Description
I don't know exactly what is causing the notice- Notice: Array to string conversion in C:\xampp\htdocs\test\io-developer-whois\vendor\io-developer\php-whois\src\Iodev\Whois\Helpers\GroupHelper.php on line 142 (This notice is produced 6 times in one run)

How to reproduce

$whois = Factory::get()->createWhois();

if ($whois->isDomainAvailable("hostadvice.co")) {
    print "Bingo! Domain is available! :)";
}
else print "Nope";

Possible Solution
I have no idea how to fix it. I am just suppressing the notice (until there is a fix by the devs) by adding an '@' sign before the isDomainAvailable method.

$whois = Factory::get()->createWhois();

if (@$whois->isDomainAvailable("hostadvice.co")) {
    print "Bingo! Domain is available! :)";
}
else print "Nope"; // No notice is visible this time
bessone commented 3 years ago

Duplicate of #94

zaherg commented 3 years ago

you might need to have a look at https://github.com/io-developer/php-whois/issues/94#issuecomment-751931853

using the following code

        $whois = Factory::get()->createWhois();
        $info = $whois->loadDomainInfo($domain);

I got the following info (for sure there are more but my application returns only a few)

image

io-developer commented 3 years ago

Can't reproduce. Possibly already fixed in master after parsing improvements.