Skip to content

Stdlib: ini_set()/ini_get() — register_argc_argv + zend.assertions parity (ext/standard, unblocks #4374) #4515

Closed

Description

@PurHur

Category

stdlib

Problem

VM ini_set() / ini_get() only support three keys (error_reporting, display_errors, memory_limit) via ext/standard/VmIni.php (#1374). Zend supports hundreds of INI entries, including register_argc_argv (needed for #4374 CLI $argc/$argv gating) and zend.assertions (needed for #3316 assert parity).

Unknown options: Zend ini_set() returns false and may emit a warning; wrong arity throws ArgumentCountError. This build throws LogicException for arity and returns false silently for unknown keys.

php-src reference

Repro

repro_ini_argv.php:

<?php
var_dump(ini_set('register_argc_argv', '0'));
var_dump(ini_get('register_argc_argv'));
var_dump($argc ?? 'unset', isset($argv));

Run with extra CLI args:

php repro_ini_argv.php a b
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro_ini_argv.php a b'

After register_argc_argv=0, Zend omits populating $argc/$argv; this compiler still exposes them today (#4374).

Second snippet — assertions INI:

<?php
var_dump(ini_set('zend.assertions', '0'));
var_dump(ini_get('zend.assertions'));

Scope (this repo)

  • ext/standard/VmIni.php, ext/standard/ini_set_.php, ext/standard/ini_get_.php
  • lib/VM/Context.php — flag for argv registration
  • CLI entry: bin/vm.php, native driver argv init (coordinate with Runtime: CLI / + ['argv'] (register_argc_argv) parity #4374)
  • JIT: ext/standard/JitIni.php / lib/AOT/runtime/phpc_ini_set.c if already used for error_reporting

Done when

Links

Activity

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

    @PurHur
    OwnerAuthor

    claim: worker-lane-a — starting this run

  3. PurHur commented on Jul 11, 2026

    @PurHur
    OwnerAuthor

    Merged via #17983.

    Verification
    ```bash
    ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
    php bin/vm.php -d register_argc_argv=0 test/repro/maintainer_gap_register_argc_argv_zero.php a b
    '

    ini_get=0 / ini_set=false / argc='unset' / argv_isset=false — matches Zend

    vendor/bin/phpunit --filter RegisterArgcArgvVMTest # OK (1 test)
    ```

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 machineimplementation-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