Skip to content

Regression: stream_context_set_option(..., null, ...) silent — Zend Deprecated (ext/standard/streamsfuncs.c) #31422

Description

@PurHur

Category

stdlib · php-src-strict

Problem

Under non-strict types, stream_context_set_option($ctx, null, $option, $value) must emit Zend’s E_DEPRECATED for null $wrapper_or_options (array|string) and still return true. VM returns true silently (no Deprecated).

Repro Zend 8.2.32 (2026-08-16) VM (2026-08-16)
stream_context_set_option($c, null, 'a', 'b') Deprecated: … Passing null to parameter #2 ($wrapper_or_options) of type array|string is deprecated + true true (no Deprecated)

Distinct from closed incomplete-args / Reflection work (#30645, #28344) and PROFILE=8.4 null TypeError (#19213).

php-src reference

PHP implementation target

  • ext/standard/stream_context_set_option.php / VmStreamContext.php / JitStreamContextSetOption.php — soft-null DEP on arg Php stdlib specs implementation #2 via shared string/array null-deprecate helper before coerce; keep success true; no new runtime/*.c

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_stream_context_set_option_null_wrapper.php'
# expect Deprecated + true (match host php)
<?php
$c = stream_context_create();
stream_context_set_option($c, null, 'a', 'b');

Done when

  • Soft null $wrapper_or_options → Zend-shaped E_DEPRECATED then true (VM + JIT/AOT when in scope)
  • Under strict_types, null still TypeErrors if that is Zend’s path for this profile
  • No silent success without the Deprecated
  • Compliance or unit guard; php-src-strict; no php-compiler-strict shortcut

Activity

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:compilerCompiler / CFG / JITarea: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