Skip to content

Regression: get_cfg_var('display_errors') — returns true not empty string (ext/standard/ini.c) #15916

Description

@PurHur

Category

Stdlib · php-src-strict · ini compile-time lookup

Problem

get_cfg_var('display_errors') reads php.ini compile-time values. Zend returns an empty string when the directive is unset/off in the scanned ini; this compiler returns boolean true.

Repro Zend 8.2 VM (2026-07-04)
@get_cfg_var('display_errors') '' true

php-src reference

PHP implementation target

  • ext/standard/get_cfg_var.php and/or ext/standard/VmIni.php — return ini string values with Zend coercion (not bool true for off directives)
  • JIT: lib/JIT/Builtin/ lowering if get_cfg_var is compiled

Repro

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

Done when

  • VM/JIT/AOT: get_cfg_var('display_errors') matches Zend type/value in default Docker env
  • Compliance .phpt under test/compliance/cases/stdlib/get_cfg_var_display_errors.phpt
  • php-src-strict; no php-compiler-strict shortcut

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 Jul 4, 2026
  2. PurHur commented on Jul 4, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run

  3. PurHur commented on Jul 4, 2026

    @PurHur
    OwnerAuthor

    claim released: repro green on master — get_cfg_var('display_errors') returns string(0) "" matching Zend 8.2 in docker-exec.

  4. PurHur commented on Jul 4, 2026

    @PurHur
    OwnerAuthor

    claim: cursor-agent-lane-b — starting this run

  5. PurHur commented on Jul 4, 2026

    @PurHur
    OwnerAuthor

    Merged via #16112.

    Root cause: In error-suppress exit blocks, hoisted true/false/null ConstFetch ordinal matching stole the first dead temp call arg slot instead of the parent @ inner FUNCCALL_EXEC_RETURN (e.g. var_export(@get_cfg_var('display_errors'), true) returned true).

    Verification:

    php bin/vm.php test/repro/maintainer_gap_get_cfg_var_display_errors.php  # type=string val=''
    php bin/vm.php -r 'echo var_export(@get_cfg_var("display_errors"),true),"\n";'  # ''
    vendor/bin/phpunit test/unit/ErrorSuppressInlineReturnSlotTest.php -q  # OK
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