|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80077 getmxrr test bug
Submitted: 2020-09-08 07:54 UTC Modified: 2020-09-08 08:00 UTC
From: rainer dot jung at kippdata dot de Assigned: nikic (profile)
Status: Closed Package: *Network Functions
PHP Version: 7.4.10 OS: Any
Private report: No CVE-ID: None
 [2020-09-08 07:54 UTC] rainer dot jung at kippdata dot de
Test file ext/standard/tests/network/getmxrr.phpt was improved recently to also contain negative tests. See

for the change in the main branch.

The domain names passed to getmxrr() do not contain a trailing dot. DNS lookups which do not find records will (depending on the local resolver config) try again by adding the local domain to the end of the searched host/domain. In many environments there's an mx record for any subdomain of the local domain and the MX query will return a hit. But the test expects no hit. So the test fails when checking that "" does not have an MX record in DNS. In our local environment the resolver falls back to also check which does have an MX record. Using "" instead of "" should fix this for everyone.

Suggested trivial change for test improvement:

--- ext/standard/tests/network/getmxrr.phpt 2020-09-01 11:45:05.000000000 +0000
+++ ext/standard/tests/network/getmxrr.phpt 2020-09-08 09:51:14.436750929 +0000
@@ -11,9 +11,9 @@
 $domains = array(
-    '',
-    '',
-    '',
+    '',
+    '',
+    '',
 foreach ($domains as $domain) {
     $result = getmxrr($domain, $hosts, $weights);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-08 08:00 UTC]
-Assigned To: +Assigned To: nikic
 [2020-09-08 08:01 UTC]
Automatic comment on behalf of
Log: Fixed bug #80077
 [2020-09-08 08:01 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 07:01:31 2024 UTC