diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-10 20:43:24 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-10 20:43:24 +0200 |
commit | 59fbdf73269fb7396f9b9bd2c3967e29cfb0bfd7 (patch) | |
tree | d42f213795b0abcd9eee0cfedff0eabc557567e1 | |
parent | 657707a105832f2cbd4de4cbdaa3fc5f48a06d97 (diff) | |
parent | 5b8b480d2303391504d7faf2ac1d92de14507b37 (diff) | |
download | php-git-59fbdf73269fb7396f9b9bd2c3967e29cfb0bfd7.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix bug #79944
-rw-r--r-- | ext/standard/dns.c | 2 | ||||
-rw-r--r-- | ext/standard/tests/network/getmxrr.phpt | 22 |
2 files changed, 14 insertions, 10 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 625c778d5b..ceb63e7e23 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -1124,7 +1124,7 @@ PHP_FUNCTION(dns_get_mx) } } php_dns_free_handle(handle); - RETURN_TRUE; + RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL_P(weight_list)) != 0); } /* }}} */ #endif /* HAVE_FULL_DNS_FUNCS */ diff --git a/ext/standard/tests/network/getmxrr.phpt b/ext/standard/tests/network/getmxrr.phpt index c4a15c52ce..52228685b0 100644 --- a/ext/standard/tests/network/getmxrr.phpt +++ b/ext/standard/tests/network/getmxrr.phpt @@ -10,15 +10,19 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -$domains = array( 'mx1.tests.php.net', 'mx2.tests.php.net' ); -foreach ( $domains as $domain ) -{ - if ( getmxrr( $domain, $hosts, $weights ) ) - { - echo "Hosts: " . count( $hosts ) . ", weights: " . count( $weights ) . "\n"; - } +$domains = array( + 'mx1.tests.php.net', + 'mx2.tests.php.net', + 'qa.php.net', +); +foreach ($domains as $domain) { + $result = getmxrr($domain, $hosts, $weights); + echo "Result: " . ($result ? "true" : "false") + . ", hosts: " . count( $hosts ) + . ", weights: " . count( $weights ) . "\n"; } ?> --EXPECT-- -Hosts: 1, weights: 1 -Hosts: 2, weights: 2 +Result: true, hosts: 1, weights: 1 +Result: true, hosts: 2, weights: 2 +Result: false, hosts: 0, weights: 0 |