Skip to content

Commit 0c74bd2

Browse files
committed
Improve error message when FD redirect target for proc_open is non-integral
1 parent a532a50 commit 0c74bd2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/standard/proc_open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ PHP_FUNCTION(proc_open)
924924
goto exit_fail;
925925
}
926926
if (Z_TYPE_P(ztarget) != IS_LONG) {
927-
zend_value_error("Redirection target must be an integer");
927+
zend_value_error("Redirection target must be an integer; got %s", zend_get_type_by_const(Z_TYPE_P(ztarget)));
928928
goto exit_fail;
929929
}
930930
if (redirect_proc_descriptor(&descriptors[ndesc], Z_LVAL_P(ztarget), descriptors, ndesc, nindex) == FAILURE) {

ext/standard/tests/general_functions/proc_open_redirect.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ proc_close($proc);
5353
?>
5454
--EXPECTF--
5555
Missing redirection target
56-
Redirection target must be an integer
56+
Redirection target must be an integer; got string
5757

5858
Warning: proc_open(): Redirection target 42 not found in %s
5959

0 commit comments

Comments
 (0)