Category
Regression · php-src-strict · stdlib socket_addrinfo_lookup() soft-null host
Problem
Without declare(strict_types=1), Zend emits E_DEPRECATED for null $host, then returns false. VM rejects with TypeError via VmString::coerceTypedStringBuiltinArg in ext/sockets/socket_addrinfo_lookup.php.
Under strict_types=1, both sides TypeError (OK). Sibling soft-null socket slices: #30313–#30316 / closed #30319–#30321.
Repro (2026-08-11, Zend 8.2.32 / master 7b9d9a1fef VM) |
Zend 8.2 |
VM |
socket_addrinfo_lookup(null); (no strict_types) |
Deprecated + false |
TypeError: Argument #1 ($host) must be of type string, null given |
php-src reference
PHP implementation target
Repro
./script/docker-exec.sh -- bash -lc 'cat > /tmp/socket_addrinfo_lookup_soft_null.php <<'"'"'PHP'"'"'
<?php
error_reporting(E_ALL);
try {
var_export(socket_addrinfo_lookup(null));
echo "\n";
} catch (Throwable $e) {
echo get_class($e), ": ", $e->getMessage(), "\n";
}
PHP
php /tmp/socket_addrinfo_lookup_soft_null.php
php bin/vm.php /tmp/socket_addrinfo_lookup_soft_null.php'
Done when
Category
Regression· php-src-strict · stdlibsocket_addrinfo_lookup()soft-null hostProblem
Without
declare(strict_types=1), Zend emitsE_DEPRECATEDfornull$host, then returnsfalse. VM rejects withTypeErrorviaVmString::coerceTypedStringBuiltinArginext/sockets/socket_addrinfo_lookup.php.Under
strict_types=1, both sides TypeError (OK). Sibling soft-null socket slices: #30313–#30316 / closed #30319–#30321.7b9d9a1fefVM)socket_addrinfo_lookup(null);(no strict_types)Deprecated+falseTypeError: Argument #1 ($host) must be of type string, null givenphp-src reference
ext/sockets/sockets.stub.php—socket_addrinfo_lookup(string $host, ?string $service = null, array $hints = []): array|falseext/sockets/sockets.c—PHP_FUNCTION(socket_addrinfo_lookup)/ hostZ_PARAM_STR(null → Deprecated + coerce)PHP implementation target
ext/sockets/socket_addrinfo_lookup.php— replace always-strictVmString::coerceTypedStringBuiltinArgwith frame-aware soft path (stringBuiltinArgForFrame/ same pattern as Regression: socket_connect(..., null) soft TypeError — Zend Deprecated+Warning+false (ext/sockets/sockets.c) #30316socket_connectaddress)Repro
Done when
socket_addrinfo_lookup(null)matches Zend Deprecated +falsedeclare(strict_types=1); socket_addrinfo_lookup(null)still TypeErrorstest/compliance/cases/ortest/repro/