3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /in/u01lg:7 Stack trace: #0 /in/u01lg(20): domain_availability(Array) #1 {main} thrown in /in/u01lg on line 7
Process exited with code 255.
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /in/u01lg:7 Stack trace: #0 /in/u01lg(20): domain_availability(Array) #1 {main} thrown in /in/u01lg on line 7
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in /in/u01lg:7 Stack trace: #0 /in/u01lg(20): domain_availability(Array) #1 {main} thrown in /in/u01lg on line 7
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.1, 5.5.21 - 5.5.38, 5.6.5 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Array ( [google.com] => 0 [hsghjgsy.org] => 0 [jsdhjs.es] => 0 [aajjks.eu] => 0 [sjdjsd.in] => 0 )
Output for 5.3.2 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.20, 5.6.0 - 5.6.4
Array ( [google.com] => 1 [hsghjgsy.org] => 1 [jsdhjs.es] => 1 [aajjks.eu] => 1 [sjdjsd.in] => 1 )
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9

Process exited with code 255.
Output for 4.3.0 - 4.3.1

preferences:
305.47 ms | 401 KiB | 459 Q