Skip to content

Stdlib: getenv() — local_only second argument (ext/standard/basic_functions.c parity) #3710

Description

@PurHur

Category

stdlib / runtime

Problem

Zend getenv(string $name, bool $local_only = false) distinguishes variables set via putenv() (local_only=true) from inherited environment entries. This build accepts only one argument.

php-src reference

Repro (today)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro-maintainer/getenv_local_only.php'
# LogicException: getenv() requires exactly one argument

./script/docker-exec.sh -- bash -lc 'php test/repro-maintainer/getenv_local_only.php'
# string(...) for both true/false when set via putenv

Scope (this repo)

Module Path
VM ext/standard/getenv_.php
JIT ext/standard/JitEnv.php
Tests test/compliance/cases/stdlib/getenv_local_only.phpt

Done when

  • Second $local_only parameter honored (VM + JIT)
  • One-arg behavior unchanged
  • ./script/ci-fast.sh --filter getenv_local_only green

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