File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -1042,19 +1042,14 @@ PHP_FUNCTION(implode)
1042
1042
RETURN_THROWS ();
1043
1043
}
1044
1044
1045
- if (pieces == NULL ) {
1046
- if (arg1_array == NULL ) {
1047
- zend_type_error ("%s(): Argument #1 ($array) must be of type array, string given" , get_active_function_name ());
1048
- RETURN_THROWS ();
1049
- }
1045
+ if (pieces != NULL && arg1_str == NULL ) {
1046
+ zend_argument_type_error (1 , "must be of type string, array given" );
1047
+ RETURN_THROWS ();
1048
+ }
1050
1049
1050
+ if (pieces == NULL ) {
1051
1051
arg1_str = ZSTR_EMPTY_ALLOC ();
1052
1052
pieces = arg1_array ;
1053
- } else {
1054
- if (arg1_str == NULL ) {
1055
- zend_argument_type_error (1 , "must be of type string, array given" );
1056
- RETURN_THROWS ();
1057
- }
1058
1053
}
1059
1054
1060
1055
php_implode (arg1_str , pieces , return_value );
Original file line number Diff line number Diff line change 22
22
} catch (TypeError $ e ) {
23
23
echo $ e ->getMessage (), "\n" ;
24
24
}
25
+ ?>
25
26
--EXPECTF--
26
27
implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
27
28
implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
You can’t perform that action at this time.
0 commit comments