Skip to content

Stdlib: stream_register_wrapper()/stream_wrapper_unregister() — legacy aliases missing (ext/standard/streams.c, pairs #3383) #6805

Closed

Description

@PurHur

Category

stdlib · php-src-strict

Problem

php-src registers two names per API for historical compatibility:

Canonical (PHP 5+) Legacy alias
stream_wrapper_register() stream_register_wrapper()
stream_wrapper_unregister() stream_wrapper_unregister()

#3383 tracks canonical registration + user wrappers, but legacy aliases are also required for framework code and php-src tests. Verified 2026-06-06 — both canonical and alias missing today:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "
foreach ([\"stream_wrapper_register\",\"stream_register_wrapper\",\"stream_wrapper_unregister\",\"stream_wrapper_unregister\"] as \$f) {
  echo \$f, \"=\", function_exists(\$f)?\"y\":\"n\", PHP_EOL;
}"'
# all n

php-src reference

  • php/php-src ext/standard/streams.c — PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, …), PHP_FALIAS(stream_wrapper_unregister, stream_wrapper_unregister, …)

Repro

<?php
var_export(function_exists('stream_register_wrapper'));
echo "\n";
var_export(function_exists('stream_wrapper_register'));
echo "\n";

Scope (this repo)

Layer Path Notes
Aliases ext/standard/stream_register_wrapper.php, stream_wrapper_unregister.php Delegate to canonical handlers once #3383 lands
Registration ext/standard/Module.php Register all four names
Tests extend test/compliance/cases/stdlib/stream_wrapper_register.phpt Assert alias function_exists + same behavior

Implement canonical stream_wrapper_register() in #3383 first; this issue is the alias slice (can land in same PR if worker claims both).

Done when

Related

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 6, 2026
  2. PurHur commented on Jun 10, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

  3. PurHur commented on Jun 10, 2026

    @PurHur
    OwnerAuthor

    Merged in #7927.

    Verification:

    • function_exists('stream_register_wrapper') → true on VM (delegates to stream_wrapper_register())
    • ./vendor/bin/phpunit --filter stream_wrapper_register test/compliance/VMTest.php → OK (1 test)

    Note: canonical stream_wrapper_unregister() was already registered (#3383/#7924); only the stream_register_wrapper legacy alias was missing from php-src PHP_FALIAS parity.

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 apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions