Skip to content

Regression: socket_addrinfo_lookup(null) soft TypeError — Zend Deprecated+false (ext/sockets/sockets.c) #30337

Description

@PurHur

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

  • Soft socket_addrinfo_lookup(null) matches Zend Deprecated + false
  • declare(strict_types=1); socket_addrinfo_lookup(null) still TypeErrors
  • Compliance/repro guard under test/compliance/cases/ or test/repro/
  • php-src-strict; VM(/JIT when implemented) agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-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