Skip to content

Commit 6e1e5c6

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

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
@@ -914,7 +914,7 @@ PHP_FUNCTION(proc_open)
914914
goto exit_fail;
915915
}
916916
if (Z_TYPE_P(ztarget) != IS_LONG) {
917-
zend_value_error("Redirection target must be an integer");
917+
zend_value_error("Redirection target must be of type int; got %s", zend_get_type_by_const(Z_TYPE_P(ztarget)));
918918
goto exit_fail;
919919
}
920920
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 of type int; got string
5757

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

0 commit comments

Comments
 (0)