Skip to content

Stdlib: stream_socket_pair() — UNIX domain socket pair (#3437) - #8316

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-stream-socket-pair-3437
Jun 13, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/stdlib-stream-socket-pair-3437

Conversation

@PurHur

@PurHur PurHur commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement stream_socket_pair() on the VM path via VmStreamSocketPairNative (libc socketpair(2) FFI, no host PHP delegation).
  • Register STREAM_PF_UNIX, STREAM_PF_INET, STREAM_SOCK_STREAM, STREAM_SOCK_DGRAM, and STREAM_IPPROTO_IP constants.
  • Add compliance PHPT, unit test, AOT compile-only smoke, and capability matrix row.

php-src reference: ext/standard/streams.c — PHP_FUNCTION(stream_socket_pair).

JIT/AOT call() lowering deferred (VM-first per issue scope); AOT compile-only smoke passes -l.

Closes #3437

Test plan

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/compliance/cases/stdlib/stream_socket_pair.phpt
vendor/bin/phpunit --filter stream_socket_pair test/compliance/
vendor/bin/phpunit --filter VmStreamSocketPairNativeTest test/unit/VmStreamSocketPairNativeTest.php
php bin/compile.php -l test/fixtures/aot/compile-only/stream_socket_pair_smoke.php
'

Output (2026-06-13):

1
pair_ok
ping
OK (3 tests, 3 assertions)   # compliance filter
OK (2 tests, 6 assertions)   # VmStreamSocketPairNativeTest
# AOT -l smoke: exit 0

Made with Cursor

Register STREAM_PF_* / STREAM_SOCK_* constants and VM builtin using
VmStreamSocketPairNative; compliance PHPT + AOT compile-only smoke verify
UNIX domain round-trip. JIT/AOT call lowering deferred.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 754a562 into master Jun 13, 2026
@PurHur
PurHur deleted the agent/stdlib-stream-socket-pair-3437 branch June 13, 2026 08:11
PurHur added a commit that referenced this pull request Jun 13, 2026
Regenerate docs/bootstrap-inventory.md and capabilities.md so
make bootstrap-inventory-check passes (2500/2500 files, 0 blockers).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: stream_socket_pair() — connected socket pair (ext/standard/streams.c parity)

1 participant