Skip to content

Fix proc_get_status() command path for argv-array proc_open (#9311) - #15527

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-9311-proc-get-status
Jul 3, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-9311-proc-get-status

Conversation

@PurHur

@PurHur PurHur commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • VmProcessProcOpenNative::openArgv() now stores argv[0] as proc_get_status()['command'], matching php-src for array-command proc_open() (was joined "$argv0 $argv1 …").
  • Adds compliance guard test/compliance/cases/stdlib/proc_get_status_argv.phpt and maintainer repro test/repro/maintainer_gap_proc_get_status_argv.php.

Closes #9311

php-src reference

  • ext/standard/proc_open.c — PHP_FUNCTION(proc_get_status) command field uses invoked path

PHP implementation

  • ext/standard/VmProcessProcOpenNative.php — openArgv() command label

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_proc_get_status_argv.php
php bin/vm.php test/compliance/cases/stdlib/proc_get_status_argv.phpt
php bin/vm.php test/compliance/cases/stdlib/proc_get_status_basic.phpt
cat > /tmp/repro_proc_get_status.php <<'"'"'PHP'"'"'
<?php
$desc = [0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => ["pipe", "w"]];
$proc = proc_open(["/bin/echo", "hi"], $desc, $pipes);
$st = proc_get_status($proc);
var_export($st["command"] ?? "MISSING");
echo "\n";
var_export($st["running"] ?? "MISSING");
echo "\n";
proc_close($proc);
PHP
php8.2 /tmp/repro_proc_get_status.php
php bin/vm.php /tmp/repro_proc_get_status.php'

Output:

ok
cmd-ok
running
has-pid
running
has-pid
cmd-ok
1
'/bin/echo'
true
'/bin/echo'
true

Made with Cursor

Store argv[0] as the command path in VmProcessProcOpenNative::openArgv so
proc_get_status() matches Zend for array-command proc_open() handles.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: proc_get_status() — must expose command argv array and running/exitcode fields (ext/standard/exec.c)

1 participant