From 484d528b40645f823047b53bcb5ba4228fb612c0 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 21 Mar 2025 13:13:25 +0000 Subject: [PATCH] ext/standard: Use usual not empty error for proc_open() (#18083) --- ext/standard/proc_open.c | 4 ++-- ext/standard/tests/general_functions/proc_open_array.phpt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 84984188f27..06a3f916a84 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -1247,8 +1247,8 @@ PHP_FUNCTION(proc_open) if (command_ht) { uint32_t num_elems = zend_hash_num_elements(command_ht); - if (num_elems == 0) { - zend_argument_value_error(1, "must have at least one element"); + if (UNEXPECTED(num_elems == 0)) { + zend_argument_must_not_be_empty_error(1); RETURN_THROWS(); } diff --git a/ext/standard/tests/general_functions/proc_open_array.phpt b/ext/standard/tests/general_functions/proc_open_array.phpt index 964b8391cb6..a76f1111ef2 100644 --- a/ext/standard/tests/general_functions/proc_open_array.phpt +++ b/ext/standard/tests/general_functions/proc_open_array.phpt @@ -76,7 +76,7 @@ proc_close($proc); ?> --EXPECT-- Empty command array: -proc_open(): Argument #1 ($command) must have at least one element +proc_open(): Argument #1 ($command) must not be empty Nul byte in program name: Command array element 1 contains a null byte