@@ -643,9 +643,9 @@ static zend_string* get_command_from_array(HashTable *array, char ***argv, uint3
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
- uint32_t 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
@@ -1002,7 +1002,8 @@ PHP_FUNCTION(proc_open)
1002
1002
{
1003
1003
zend_string * command_str ;
1004
1004
HashTable * command_ht ;
1005
- zval * descriptorspec , * pipes ; /* Mandatory arguments */
1005
+ HashTable * descriptorspec ; /* Mandatory argument */
1006
+ zval * pipes ; /* Mandatory argument */
1006
1007
char * cwd = NULL ; /* Optional argument */
1007
1008
size_t cwd_len = 0 ; /* Optional argument */
1008
1009
zval * environment = NULL , * other_options = NULL ; /* Optional arguments */
@@ -1038,7 +1039,7 @@ PHP_FUNCTION(proc_open)
1038
1039
1039
1040
ZEND_PARSE_PARAMETERS_START (3 , 6 )
1040
1041
Z_PARAM_ARRAY_HT_OR_STR (command_ht , command_str )
1041
- Z_PARAM_ARRAY (descriptorspec )
1042
+ Z_PARAM_ARRAY_HT (descriptorspec )
1042
1043
Z_PARAM_ZVAL (pipes )
1043
1044
Z_PARAM_OPTIONAL
1044
1045
Z_PARAM_STRING_OR_NULL (cwd , cwd_len )
@@ -1088,7 +1089,7 @@ PHP_FUNCTION(proc_open)
1088
1089
descriptors = alloc_descriptor_array (descriptorspec );
1089
1090
1090
1091
/* Walk the descriptor spec and set up files/pipes */
1091
- ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P ( descriptorspec ) , nindex , str_index , descitem ) {
1092
+ ZEND_HASH_FOREACH_KEY_VAL (descriptorspec , nindex , str_index , descitem ) {
1092
1093
if (str_index ) {
1093
1094
zend_argument_value_error (2 , "must be an integer indexed array" );
1094
1095
goto exit_fail ;
0 commit comments