Skip to content

Stdlib: stream_socket_get_name() missing — undefined function (ext/standard/streamsfuncs.c) #12223

Closed

Description

@PurHur

Summary

stream_socket_get_name() is a core streams builtin in php-src (bound socket name / peer address). It is not registered in this compiler: function_exists('stream_socket_get_name') is false and calls fatal.

Used by serve smoke tests and lib/Web/DevServer.php when running compiled code; today those paths rely on host Zend only.

php-src reference: ext/standard/streamsfuncs.c — PHP_FUNCTION(stream_socket_get_name).

PHP implementation target: ext/standard/ stream socket helpers (reuse existing socket resource layer + VmStreams); register in ext/standard/Module.php; JIT via streams lowering — thin C ABI only if unavoidable.

Repro (php-src-strict)

./script/docker-exec.sh -- bash -lc '
  php test/repro/maintainer_gap_stream_socket_get_name.php
  php bin/vm.php test/repro/maintainer_gap_stream_socket_get_name.php
'

Zend: function_exists → true; stream_socket_get_name($srv, false) → '127.0.0.1:PORT'
VM: function_exists → false; fatal Call to undefined function stream_socket_get_name()

Done when

  • stream_socket_get_name($stream, $want_peer) registered on VM/JIT/AOT; capability matrix row added.
  • Returns local bind name when $want_peer=false, peer when true (connected socket).
  • Compliance .phpt; php-src-strict.

Activity

  1. added
    enhancementNew feature or request
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jun 26, 2026
  2. PurHur commented on Jun 26, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #12225, #12224, #12223)

  3. PurHur commented on Jun 26, 2026

    @PurHur
    OwnerAuthor

    Merged via PR. VM + JIT compliance green: stream_socket_get_name returns 127.0.0.1:PORT for TCP server bind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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