Skip to content

Commit 90330a4

Browse files
committed
Drop redundant arg count check
1 parent 45d69fb commit 90330a4

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

ext/standard/formatted_print.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,6 @@ PHP_FUNCTION(fprintf)
866866
int argc;
867867
zend_string *result;
868868

869-
if (ZEND_NUM_ARGS() < 2) {
870-
WRONG_PARAM_COUNT;
871-
}
872-
873869
ZEND_PARSE_PARAMETERS_START(2, -1)
874870
Z_PARAM_RESOURCE(arg1)
875871
Z_PARAM_STRING(format, format_len)
@@ -901,10 +897,6 @@ PHP_FUNCTION(vfprintf)
901897
int argc;
902898
zend_string *result;
903899

904-
if (ZEND_NUM_ARGS() != 3) {
905-
WRONG_PARAM_COUNT;
906-
}
907-
908900
ZEND_PARSE_PARAMETERS_START(3, 3)
909901
Z_PARAM_RESOURCE(arg1)
910902
Z_PARAM_STRING(format, format_len)

ext/standard/tests/strings/fprintf_error.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ echo "Done\n";
3131
?>
3232
--EXPECT--
3333
*** Testing Error Conditions ***
34-
Wrong parameter count for fprintf()
35-
Wrong parameter count for fprintf()
36-
Wrong parameter count for fprintf()
34+
fprintf() expects at least 2 parameters, 0 given
35+
fprintf() expects at least 2 parameters, 1 given
36+
fprintf() expects at least 2 parameters, 1 given
3737
Done

ext/standard/tests/strings/vfprintf_error1.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ unlink( $file );
3838
?>
3939
--EXPECT--
4040
-- Testing vfprintf() function with more than expected no. of arguments --
41-
Wrong parameter count for vfprintf()
42-
Wrong parameter count for vfprintf()
41+
vfprintf() expects exactly 3 parameters, 4 given
42+
vfprintf() expects exactly 3 parameters, 4 given

0 commit comments

Comments
 (0)