Category
bug · php-src-strict · Reflection / stubs
Problem
Network service/protocol name lookup builtins exist and accept Zend named args, but Reflection return types drop |false. Zend stubs advertise int|false / string|false for lookup failure. Probed 2026-08-01 vs host Zend 8.2.32 / php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-01) |
getservbyname return |
int|false |
int |
getservbyport return |
string|false |
string |
getprotobyname return |
int|false |
int |
getprotobynumber return |
string|false |
string |
named getservbyname(service:, protocol:) |
ok |
ok (names ok) |
php-src reference
PHP implementation target
- Builtin / Internal Reflection metadata in
ext/standard (or network helpers) — advertise |false return unions matching stubs
- PHP-in-PHP only; no new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php -r '\''
foreach (["getservbyname","getservbyport","getprotobyname","getprotobynumber"] as $f) {
echo $f, " ret=", (string)(new ReflectionFunction($f))->getReturnType(), "\n";
}
'\''
php bin/vm.php -r '\''
foreach (["getservbyname","getservbyport","getprotobyname","getprotobynumber"] as $f) {
echo $f, " ret=", (string)(new ReflectionFunction($f))->getReturnType(), "\n";
}
'\'''
Done when
Maintainer gate note (2026-08-01)
Pillar 1: user_release_ready: yes — inventory OK 6658/6658; north-star5-fast ok; gen-0 seed stale (46d).
Category
bug· php-src-strict · Reflection / stubsProblem
Network service/protocol name lookup builtins exist and accept Zend named args, but Reflection return types drop
|false. Zend stubs advertiseint|false/string|falsefor lookup failure. Probed 2026-08-01 vs host Zend 8.2.32 /php bin/vm.php.getservbynamereturnint|falseintgetservbyportreturnstring|falsestringgetprotobynamereturnint|falseintgetprotobynumberreturnstring|falsestringgetservbyname(service:, protocol:)php-src reference
ext/standard/basic_functions.stub.php—getservbyname/getservbyport/getprotobyname/getprotobynumberext/standard/network.c— network lookup handlersPHP implementation target
ext/standard(or network helpers) — advertise|falsereturn unions matching stubsruntime/*.cRepro
Done when
int|false/string|false) for all four.phpt+test/repro/issue_NNNN_network_svc_ret.phpMaintainer gate note (2026-08-01)
Pillar 1:
user_release_ready: yes— inventoryOK 6658/6658;north-star5-fastok; gen-0 seed stale (46d).