3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function domain_availability($domains){ foreach ($domains as $domain) { $ns= @dns_get_record($domain,DNS_NS); if(count($ns)) { $rs[$domain]=0; } else { $rs[$domain]=1; } } return $rs; } $domains=array("google.com","hsghjgsy.org","jsdhjs.es","aajjks.eu","sjdjsd.in"); $rs=domain_availability($domains); print_r($rs);
Output for 7.2.0 - 7.2.6
Warning: count(): Parameter must be an array or an object that implements Countable in /in/u01lg on line 7 Warning: count(): Parameter must be an array or an object that implements Countable in /in/u01lg on line 7 Warning: count(): Parameter must be an array or an object that implements Countable in /in/u01lg on line 7 Warning: count(): Parameter must be an array or an object that implements Countable in /in/u01lg on line 7 Warning: count(): Parameter must be an array or an object that implements Countable in /in/u01lg on line 7 Array ( [google.com] => 0 [hsghjgsy.org] => 0 [jsdhjs.es] => 0 [aajjks.eu] => 0 [sjdjsd.in] => 0 )
Output for 5.0.0 - 5.3.1, 5.5.24 - 7.1.20
Array ( [google.com] => 0 [hsghjgsy.org] => 0 [jsdhjs.es] => 0 [aajjks.eu] => 0 [sjdjsd.in] => 0 )
Output for 5.3.2 - 5.4.45
Array ( [google.com] => 1 [hsghjgsy.org] => 1 [jsdhjs.es] => 1 [aajjks.eu] => 1 [sjdjsd.in] => 1 )
Output for 4.3.2 - 4.4.9

Process exited with code 255.
Output for 4.3.0 - 4.3.1