Skip to content

Stdlib: dns_get_record(DNS_AAAA) returns false not array — localhost lookup (ext/standard/dns.c) #10818

Description

@PurHur

Summary

dns_get_record('localhost', DNS_AAAA) must return an array (empty or with AAAA rows). This compiler returns false, breaking count() and downstream callers.

Zend on the same host returns an array with one ::1 AAAA record.

php-src reference

  • ext/standard/dns.cphp_dns_get_record() / add_dns_record() for DNS_AAAA

Repro

test/repro/maintainer_gap_dns_get_record_aaaa_false.php:

./script/docker-exec.sh -- php test/repro/maintainer_gap_dns_get_record_aaaa_false.php      # PASS (count=1)
./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_gap_dns_get_record_aaaa_false.php  # FAIL: boolean

Expected (php-src-strict)

Always array on success path; never false when resolver returns records. Match Zend record shape (host, type, ipv6, ttl, …).

Implementation hints (PHP-in-PHP)

  • Fix AAAA branch in DNS builtin (ext/standard); share A-record parser where possible.

Done when

  • Repro green on VM
  • DNS_A + DNS_AAAA combined flag smoke if applicable

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 appsstdlib

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions