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
Category
bug· php-src-strict · Reflection returns · pillar 4Problem
exec/system/passthru/shell_execReflection return types drift from php-src stubs. Sibling #23625 / #23597 cover parameter names (return_valuevsresult_code,cmdvscommand) — this issue is return-type parity only.Probed 2026-08-08 @
b590cebf57vsphp:8.4-cli:execstring|falsestringsystemstring|falseintpassthru?false(false|null)-)shell_execstring|false|nullstringphp-src reference
ext/standard/basic_functions.stub.php—exec/system/passthru/shell_execstubsPHP implementation target
ext/standardReflection/arginfo for these four returns to match stubs; coordinate with Regression: exec/passthru/system Reflection names return_value — Zend result_code; named args rejected (ext/standard/exec.stub.php) #23625/Regression: shell_exec/fstat/fpassthru/disk_* Reflection names drift — Zend command/stream/directory rejected (ext/standard stubs) #23597 name fixes; PHP-in-PHP onlyRepro
Done when
.phptguard