|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-05-11 09:32 UTC] laruence@php.net
[2016-05-11 09:32 UTC] laruence@php.net
-Status: Open
+Status: Closed
[2016-07-20 11:31 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Description: ------------ This function should return an array of associative arrays for each record, or false on failure. Somehow it may happen that the returned array contains elements of the type 'unknown' instead of 'array'. Running the same function on the same hostname multiple times shows that this problem seems to be random. Whatever you try to do with the value results in an error. Printing it or using json_encode results in the script simply dying in my case. Test script: --------------- foreach (dns_get_record($hostname, DNS_A) as $record) { if (array_key_exists('host', $record)) { echo $record['host'] . "\n"; } } Actual result: -------------- Fatal error: Uncaught TypeError: array_key_exists() expects parameter 2 to be array, unknown given in ...