Category
stdlib | spec refresh (2026-06-17)
Problem
Registration gap closed: gethostbyname(), gethostbyaddr(), dns_get_record(), checkdnsrr(), and dns_check_record() are registered in ext/standard/Module.php and return data on VM (audit 2026-06-17).
Remaining php-src-strict parity (file sub-issues or checklist items here):
| Gap |
Tracker |
dns_get_record() TTL field always 0 |
#9307 |
| JIT/AOT lowering missing or host-FFI only |
implement after VM guards green |
DNS_* constant edge values vs php-src |
verify ext/standard/VmConstants.php |
Resolver failure shapes (false + warnings) |
match ext/standard/dns.c |
Offline CI @requires network |
document skip policy |
This issue stays the umbrella for DNS family completeness; workers should claim #9307 or add focused repro issues rather than re-implementing registration.
php-src reference
Repro (registration — GREEN)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "
foreach ([\"gethostbyname\",\"dns_get_record\",\"checkdnsrr\",\"gethostbyaddr\"] as \$f)
echo \$f,\": \", function_exists(\$f)?\"yes\":\"no\", PHP_EOL;
"'
# 2026-06-17: all yes
Repro (behavior — compare Zend)
<?php
echo gethostbyname('localhost'), "\n";
$r = dns_get_record('example.com', DNS_A);
var_export(is_array($r));
if (is_array($r) && isset($r[0]['ttl'])) {
echo "\nttl=", $r[0]['ttl'], "\n";
}
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php'
php repro.php
| Check |
Zend |
VM (audit) |
gethostbyname('localhost') |
127.0.0.1 / ::1 |
127.0.0.1 |
dns_get_record(..., DNS_A) array |
yes |
yes |
ttl field |
resolver TTL |
0 (#9307) |
Scope
| Module |
Path |
| VM |
ext/standard/gethostbyname.php, gethostbyaddr.php, dns_get_record.php, checkdnsrr.php |
| Constants |
ext/standard/VmConstants.php |
| JIT/AOT |
host resolver wrappers after VM parity |
| Tests |
test/compliance/cases/stdlib/gethostbyname.phpt, dns_get_record*.phpt |
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter gethostbyname'
php script/capability-matrix.php
Related
Category
stdlib| spec refresh (2026-06-17)Problem
Registration gap closed:
gethostbyname(),gethostbyaddr(),dns_get_record(),checkdnsrr(), anddns_check_record()are registered inext/standard/Module.phpand return data on VM (audit 2026-06-17).Remaining php-src-strict parity (file sub-issues or checklist items here):
dns_get_record()TTL field always0DNS_*constant edge values vs php-srcext/standard/VmConstants.phpfalse+ warnings)ext/standard/dns.c@requiresnetworkThis issue stays the umbrella for DNS family completeness; workers should claim #9307 or add focused repro issues rather than re-implementing registration.
php-src reference
ext/standard/dns.c— all DNS builtinsext/standard/basic_functions.c—DNS_A,DNS_MX,DNS_ALL, …Repro (registration — GREEN)
Repro (behavior — compare Zend)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php' php repro.phpgethostbyname('localhost')127.0.0.1/::1127.0.0.1dns_get_record(..., DNS_A)arrayttlfield0(#9307)Scope
ext/standard/gethostbyname.php,gethostbyaddr.php,dns_get_record.php,checkdnsrr.phpext/standard/VmConstants.phptest/compliance/cases/stdlib/gethostbyname.phpt,dns_get_record*.phptDone when
dns_get_record()TTL matches Zend on networked hosts (Stdlib: dns_get_record() — TTL field always 0 not resolver TTL (ext/standard/dns.c) #9307)docs/capabilities.md(or green PHPTs)./script/ci-fast.sh --filter gethostbynamegreen (offline skips OK)Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter gethostbyname' php script/capability-matrix.phpRelated