@@ -643,9 +643,9 @@ static zend_string* get_command_from_array(HashTable *array, char ***argv, int n
643
643
return command ;
644
644
}
645
645
646
- static descriptorspec_item * alloc_descriptor_array (zval * descriptorspec )
646
+ static descriptorspec_item * alloc_descriptor_array (HashTable * descriptorspec )
647
647
{
648
- int ndescriptors = zend_hash_num_elements (Z_ARRVAL_P ( descriptorspec ) );
648
+ uint32_t ndescriptors = zend_hash_num_elements (descriptorspec );
649
649
return ecalloc (sizeof (descriptorspec_item ), ndescriptors );
650
650
}
651
651
@@ -998,7 +998,8 @@ PHP_FUNCTION(proc_open)
998
998
{
999
999
zend_string * command_str ;
1000
1000
HashTable * command_ht ;
1001
- zval * descriptorspec , * pipes ; /* Mandatory arguments */
1001
+ HashTable * descriptorspec ; /* Mandatory argument */
1002
+ zval * pipes ; /* Mandatory argument */
1002
1003
char * cwd = NULL ; /* Optional argument */
1003
1004
size_t cwd_len = 0 ; /* Optional argument */
1004
1005
zval * environment = NULL , * other_options = NULL ; /* Optional arguments */
@@ -1034,7 +1035,7 @@ PHP_FUNCTION(proc_open)
1034
1035
1035
1036
ZEND_PARSE_PARAMETERS_START (3 , 6 )
1036
1037
Z_PARAM_ARRAY_HT_OR_STR (command_ht , command_str )
1037
- Z_PARAM_ARRAY (descriptorspec )
1038
+ Z_PARAM_ARRAY_HT (descriptorspec )
1038
1039
Z_PARAM_ZVAL (pipes )
1039
1040
Z_PARAM_OPTIONAL
1040
1041
Z_PARAM_STRING_OR_NULL (cwd , cwd_len )
@@ -1084,7 +1085,7 @@ PHP_FUNCTION(proc_open)
1084
1085
descriptors = alloc_descriptor_array (descriptorspec );
1085
1086
1086
1087
/* Walk the descriptor spec and set up files/pipes */
1087
- ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P ( descriptorspec ) , nindex , str_index , descitem ) {
1088
+ ZEND_HASH_FOREACH_KEY_VAL (descriptorspec , nindex , str_index , descitem ) {
1088
1089
if (str_index ) {
1089
1090
zend_argument_value_error (2 , "must be an integer indexed array" );
1090
1091
goto exit_fail ;
0 commit comments