@@ -4613,7 +4613,6 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
4613
4613
int (* intersect_data_compare_func )(zval * , zval * ) = NULL ;
4614
4614
zend_bool ok ;
4615
4615
zval * val , * data ;
4616
- int req_args ;
4617
4616
char * param_spec ;
4618
4617
zend_string * key ;
4619
4618
zend_ulong h ;
@@ -4622,25 +4621,18 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
4622
4621
argc = ZEND_NUM_ARGS ();
4623
4622
if (data_compare_type == INTERSECT_COMP_DATA_USER ) {
4624
4623
/* INTERSECT_COMP_DATA_USER - array_uintersect_assoc() */
4625
- req_args = 3 ;
4626
4624
param_spec = "+f" ;
4627
4625
intersect_data_compare_func = zval_user_compare ;
4628
4626
} else {
4629
4627
/* INTERSECT_COMP_DATA_NONE - array_intersect_key()
4630
4628
INTERSECT_COMP_DATA_INTERNAL - array_intersect_assoc() */
4631
- req_args = 2 ;
4632
4629
param_spec = "+" ;
4633
4630
4634
4631
if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL ) {
4635
4632
intersect_data_compare_func = zval_compare ;
4636
4633
}
4637
4634
}
4638
4635
4639
- if (argc < req_args ) {
4640
- zend_argument_count_error ("At least %d arguments are required, %d given" , req_args , argc );
4641
- RETURN_THROWS ();
4642
- }
4643
-
4644
4636
if (zend_parse_parameters (ZEND_NUM_ARGS (), param_spec , & args , & argc , & BG (user_compare_fci ), & BG (user_compare_fci_cache )) == FAILURE ) {
4645
4637
RETURN_THROWS ();
4646
4638
}
@@ -4701,7 +4693,6 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
4701
4693
int arr_argc , i , c = 0 ;
4702
4694
uint32_t idx ;
4703
4695
Bucket * * lists , * list , * * ptrs , * p ;
4704
- uint32_t req_args ;
4705
4696
char * param_spec ;
4706
4697
zend_fcall_info fci1 , fci2 ;
4707
4698
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache , fci2_cache = empty_fcall_info_cache ;
@@ -4717,24 +4708,17 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
4717
4708
4718
4709
if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL ) {
4719
4710
/* array_intersect() */
4720
- req_args = 2 ;
4721
4711
param_spec = "+" ;
4722
4712
intersect_data_compare_func = php_array_data_compare_string_unstable ;
4723
4713
} else if (data_compare_type == INTERSECT_COMP_DATA_USER ) {
4724
4714
/* array_uintersect() */
4725
- req_args = 3 ;
4726
4715
param_spec = "+f" ;
4727
4716
intersect_data_compare_func = php_array_user_compare_unstable ;
4728
4717
} else {
4729
4718
ZEND_ASSERT (0 && "Invalid data_compare_type" );
4730
4719
return ;
4731
4720
}
4732
4721
4733
- if (ZEND_NUM_ARGS () < req_args ) {
4734
- zend_argument_count_error ("At least %d arguments are required, %d given" , req_args , ZEND_NUM_ARGS ());
4735
- RETURN_THROWS ();
4736
- }
4737
-
4738
4722
if (zend_parse_parameters (ZEND_NUM_ARGS (), param_spec , & args , & arr_argc , & fci1 , & fci1_cache ) == FAILURE ) {
4739
4723
RETURN_THROWS ();
4740
4724
}
@@ -4747,29 +4731,25 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
4747
4731
4748
4732
if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL && key_compare_type == INTERSECT_COMP_KEY_INTERNAL ) {
4749
4733
/* array_intersect_assoc() or array_intersect_key() */
4750
- req_args = 2 ;
4751
4734
param_spec = "+" ;
4752
4735
intersect_key_compare_func = php_array_key_compare_string_unstable ;
4753
4736
intersect_data_compare_func = php_array_data_compare_string_unstable ;
4754
4737
} else if (data_compare_type == INTERSECT_COMP_DATA_USER && key_compare_type == INTERSECT_COMP_KEY_INTERNAL ) {
4755
4738
/* array_uintersect_assoc() */
4756
- req_args = 3 ;
4757
4739
param_spec = "+f" ;
4758
4740
intersect_key_compare_func = php_array_key_compare_string_unstable ;
4759
4741
intersect_data_compare_func = php_array_user_compare_unstable ;
4760
4742
fci_data = & fci1 ;
4761
4743
fci_data_cache = & fci1_cache ;
4762
4744
} else if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL && key_compare_type == INTERSECT_COMP_KEY_USER ) {
4763
4745
/* array_intersect_uassoc() or array_intersect_ukey() */
4764
- req_args = 3 ;
4765
4746
param_spec = "+f" ;
4766
4747
intersect_key_compare_func = php_array_user_key_compare_unstable ;
4767
4748
intersect_data_compare_func = php_array_data_compare_string_unstable ;
4768
4749
fci_key = & fci1 ;
4769
4750
fci_key_cache = & fci1_cache ;
4770
4751
} else if (data_compare_type == INTERSECT_COMP_DATA_USER && key_compare_type == INTERSECT_COMP_KEY_USER ) {
4771
4752
/* array_uintersect_uassoc() */
4772
- req_args = 4 ;
4773
4753
param_spec = "+ff" ;
4774
4754
intersect_key_compare_func = php_array_user_key_compare_unstable ;
4775
4755
intersect_data_compare_func = php_array_user_compare_unstable ;
@@ -4782,11 +4762,6 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
4782
4762
return ;
4783
4763
}
4784
4764
4785
- if (ZEND_NUM_ARGS () < req_args ) {
4786
- zend_argument_count_error ("At least %d arguments are required, %d given" , req_args , ZEND_NUM_ARGS ());
4787
- RETURN_THROWS ();
4788
- }
4789
-
4790
4765
if (zend_parse_parameters (ZEND_NUM_ARGS (), param_spec , & args , & arr_argc , & fci1 , & fci1_cache , & fci2 , & fci2_cache ) == FAILURE ) {
4791
4766
RETURN_THROWS ();
4792
4767
}
@@ -5023,19 +4998,11 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
5023
4998
/* Get the argument count */
5024
4999
argc = ZEND_NUM_ARGS ();
5025
5000
if (data_compare_type == DIFF_COMP_DATA_USER ) {
5026
- if (argc < 3 ) {
5027
- zend_argument_count_error ("At least 3 arguments are required, %d given" , ZEND_NUM_ARGS ());
5028
- RETURN_THROWS ();
5029
- }
5030
5001
if (zend_parse_parameters (ZEND_NUM_ARGS (), "+f" , & args , & argc , & BG (user_compare_fci ), & BG (user_compare_fci_cache )) == FAILURE ) {
5031
5002
RETURN_THROWS ();
5032
5003
}
5033
5004
diff_data_compare_func = zval_user_compare ;
5034
5005
} else {
5035
- if (argc < 2 ) {
5036
- zend_argument_count_error ("At least 2 arguments are required, %d given" , ZEND_NUM_ARGS ());
5037
- RETURN_THROWS ();
5038
- }
5039
5006
if (zend_parse_parameters (ZEND_NUM_ARGS (), "+" , & args , & argc ) == FAILURE ) {
5040
5007
RETURN_THROWS ();
5041
5008
}
@@ -5100,7 +5067,6 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
5100
5067
int arr_argc , i , c ;
5101
5068
uint32_t idx ;
5102
5069
Bucket * * lists , * list , * * ptrs , * p ;
5103
- uint32_t req_args ;
5104
5070
char * param_spec ;
5105
5071
zend_fcall_info fci1 , fci2 ;
5106
5072
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache , fci2_cache = empty_fcall_info_cache ;
@@ -5116,24 +5082,17 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
5116
5082
5117
5083
if (data_compare_type == DIFF_COMP_DATA_INTERNAL ) {
5118
5084
/* array_diff */
5119
- req_args = 2 ;
5120
5085
param_spec = "+" ;
5121
5086
diff_data_compare_func = php_array_data_compare_string_unstable ;
5122
5087
} else if (data_compare_type == DIFF_COMP_DATA_USER ) {
5123
5088
/* array_udiff */
5124
- req_args = 3 ;
5125
5089
param_spec = "+f" ;
5126
5090
diff_data_compare_func = php_array_user_compare_unstable ;
5127
5091
} else {
5128
5092
ZEND_ASSERT (0 && "Invalid data_compare_type" );
5129
5093
return ;
5130
5094
}
5131
5095
5132
- if (ZEND_NUM_ARGS () < req_args ) {
5133
- zend_argument_count_error ("At least %d arguments are required, %d given" , req_args , ZEND_NUM_ARGS ());
5134
- RETURN_THROWS ();
5135
- }
5136
-
5137
5096
if (zend_parse_parameters (ZEND_NUM_ARGS (), param_spec , & args , & arr_argc , & fci1 , & fci1_cache ) == FAILURE ) {
5138
5097
RETURN_THROWS ();
5139
5098
}
@@ -5146,29 +5105,25 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
5146
5105
5147
5106
if (data_compare_type == DIFF_COMP_DATA_INTERNAL && key_compare_type == DIFF_COMP_KEY_INTERNAL ) {
5148
5107
/* array_diff_assoc() or array_diff_key() */
5149
- req_args = 2 ;
5150
5108
param_spec = "+" ;
5151
5109
diff_key_compare_func = php_array_key_compare_string_unstable ;
5152
5110
diff_data_compare_func = php_array_data_compare_string_unstable ;
5153
5111
} else if (data_compare_type == DIFF_COMP_DATA_USER && key_compare_type == DIFF_COMP_KEY_INTERNAL ) {
5154
5112
/* array_udiff_assoc() */
5155
- req_args = 3 ;
5156
5113
param_spec = "+f" ;
5157
5114
diff_key_compare_func = php_array_key_compare_string_unstable ;
5158
5115
diff_data_compare_func = php_array_user_compare_unstable ;
5159
5116
fci_data = & fci1 ;
5160
5117
fci_data_cache = & fci1_cache ;
5161
5118
} else if (data_compare_type == DIFF_COMP_DATA_INTERNAL && key_compare_type == DIFF_COMP_KEY_USER ) {
5162
5119
/* array_diff_uassoc() or array_diff_ukey() */
5163
- req_args = 3 ;
5164
5120
param_spec = "+f" ;
5165
5121
diff_key_compare_func = php_array_user_key_compare_unstable ;
5166
5122
diff_data_compare_func = php_array_data_compare_string_unstable ;
5167
5123
fci_key = & fci1 ;
5168
5124
fci_key_cache = & fci1_cache ;
5169
5125
} else if (data_compare_type == DIFF_COMP_DATA_USER && key_compare_type == DIFF_COMP_KEY_USER ) {
5170
5126
/* array_udiff_uassoc() */
5171
- req_args = 4 ;
5172
5127
param_spec = "+ff" ;
5173
5128
diff_key_compare_func = php_array_user_key_compare_unstable ;
5174
5129
diff_data_compare_func = php_array_user_compare_unstable ;
@@ -5181,11 +5136,6 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
5181
5136
return ;
5182
5137
}
5183
5138
5184
- if (ZEND_NUM_ARGS () < req_args ) {
5185
- zend_argument_count_error ("At least %d arguments are required, %d given" , req_args , ZEND_NUM_ARGS ());
5186
- RETURN_THROWS ();
5187
- }
5188
-
5189
5139
if (zend_parse_parameters (ZEND_NUM_ARGS (), param_spec , & args , & arr_argc , & fci1 , & fci1_cache , & fci2 , & fci2_cache ) == FAILURE ) {
5190
5140
RETURN_THROWS ();
5191
5141
}
@@ -5377,11 +5327,6 @@ PHP_FUNCTION(array_diff)
5377
5327
zend_long idx ;
5378
5328
zval dummy ;
5379
5329
5380
- if (ZEND_NUM_ARGS () < 2 ) {
5381
- zend_argument_count_error ("At least 2 arguments are required, %d given" , ZEND_NUM_ARGS ());
5382
- RETURN_THROWS ();
5383
- }
5384
-
5385
5330
ZEND_PARSE_PARAMETERS_START (1 , -1 )
5386
5331
Z_PARAM_VARIADIC ('+' , args , argc )
5387
5332
ZEND_PARSE_PARAMETERS_END ();
0 commit comments