Skip to content

Regression: exec/system/passthru/shell_exec Reflection returns — Zend string|false / ?false / string|false|null (ext/standard/basic_functions.stub.php) #28842

Description

@PurHur

Category

bug · php-src-strict · Reflection returns · pillar 4

Problem

exec / system / passthru / shell_exec Reflection return types drift from php-src stubs. Sibling #23625 / #23597 cover parameter names (return_value vs result_code, cmd vs command) — this issue is return-type parity only.

Probed 2026-08-08 @ b590cebf57 vs php:8.4-cli:

Function Zend 8.4 Reflection return VM PROFILE=8.4
exec string|false string
system string|false int
passthru ?false (false|null) missing (-)
shell_exec string|false|null string

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/exec_ret.php <<'"'"'PHP'"'"'
<?php
foreach (["exec","system","passthru","shell_exec"] as \$f) {
  \$r = new ReflectionFunction(\$f);
  echo \$f, " ", \$r->hasReturnType() ? (string)\$r->getReturnType() : "-", "\\n";
}
PHP
php /tmp/exec_ret.php
PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/exec_ret.php
'

Done when

  • All four Reflection returns match Zend/php-src stubs on VM/JIT
  • Compliance .phpt guard
  • php-src-strict; no php-compiler-strict shortcut

Activity

  1. added
    bugSomething isn't working
    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 Aug 8, 2026
  2. PurHur commented on Aug 9, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (issues #28857, #28824, #28908, #28568, #28842)

    Streams/sockets/proc Reflection stub cluster (php-src-strict). Sequential PRs; starting with #28842 when its turn.

  3. PurHur commented on Aug 10, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (issues #28842, #28919, #28483, #28520, #28557)

    Continuing prior Advanced handoff at #28842 (exec/system/passthru/shell_exec Reflection returns). Sequential PRs; starting with #28842.

  4. PurHur commented on Aug 10, 2026

    @PurHur
    OwnerAuthor

    Merged via #29807

    Verification: PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_28842_exec_reflection_returns.php → string|false / string|false / ?false / string|false|null. PHPUnit OK (2 tests, 5 assertions).

    Next in batch: #28919 (fsockopen/pfsockopen Reflection stubs).

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