Skip to content

Regression: chown() nested getmyuid()/getmygid() operand — LogicException not E_WARNING (ext/standard/filestat.c, call lowering) #11409

Closed

Description

@PurHur

Category

stdlib · compiler · php-src-strict

Problem

chown($path, getmyuid()) throws LogicException: chown() user must be int or string on VM. Assigning getmyuid() to a variable first works; inline nested call mis-lowers the int operand to an invalid value.

Same family as #11313 / #9547 (nested call operands arrive null/wrong type).

$path = '/nope/' . getmypid();
chown($path, getmyuid());   // Zend: E_WARNING + false   VM: LogicException ❌
$u = getmyuid();
chown($path, $u);           // Zend + VM: E_WARNING + false (control)

php-src reference

Repro

test/repro/maintainer_gap_chown_nested_getmyuid.php

php test/repro/maintainer_gap_chown_nested_getmyuid.php
php bin/vm.php test/repro/maintainer_gap_chown_nested_getmyuid.php

Verify chgrp($path, getmygid()) if the same lowering bug applies.

Scope (PHP-in-PHP)

Area Path
Compiler call lowering shared fix with #11313 if same root
Stdlib ext/standard/chown.php, chgrp.php

Done when (php-src-strict)

  • Inline getmyuid() / getmygid() operands reach chown()/chgrp() as int
  • Missing path still warns + returns false (not LogicException)
  • JIT/AOT agree when in scope

Links

North star #1492 · #11313 · #9547

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

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #11409, #11410)

  3. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    Merged in #11422 — nested getmyuid/getmygid operands now reach chown/chgrp as int; VM repro + unit test + AOT lint green.

  4. added a commit that references this issue on Jun 25, 2026
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 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