Skip to content

Stdlib: getmxrr() — MX record lookup (ext/standard/dns.c parity) #3662

Description

@PurHur

Category

stdlib

Problem

getmxrr(string $hostname, array &$mxhosts, array &$weight = null): bool is missing. Mail routing and hostname validation code depends on MX lookups; function_exists('getmxrr') is false under bin/vm.php (host PHP has it).

Split from #3258 (A/AAAA/dns_get_record family) so MX work can land independently.

php-src reference

Repro (failure today)

<?php
$hosts = [];
$weights = [];
$ok = getmxrr('example.com', $hosts, $weights);
var_export($ok);
echo "\n", count($hosts), "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php'
# Fatal: Call to undefined function getmxrr()

Zend (reference):

php repro.php
# bool(true) and non-empty $hosts on typical resolver

Scope (this repo)

Done when

  • Repro runs without undefined-function fatal on VM
  • $mxhosts populated as string list; $weights as int list when passed (Zend subset)
  • Returns false when no MX records (match Zend on test hostname)
  • ./script/ci-fast.sh --filter getmxrr green

Verification

./script/ci-fast.sh --filter getmxrr

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions