]> granicus.if.org Git - php/commitdiff
Drop redundant arg count check
authorGeorge Peter Banyard <girgias@php.net>
Thu, 13 Aug 2020 00:37:00 +0000 (02:37 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Thu, 13 Aug 2020 00:37:00 +0000 (02:37 +0200)
ext/standard/formatted_print.c
ext/standard/tests/strings/fprintf_error.phpt
ext/standard/tests/strings/vfprintf_error1.phpt

index 9c65586f63ab5ffa976df673fa04157c4aae6bee..12d3d3df7deccf27b26d6c62bd21e77bdc2bbcc1 100644 (file)
@@ -866,10 +866,6 @@ PHP_FUNCTION(fprintf)
        int argc;
        zend_string *result;
 
-       if (ZEND_NUM_ARGS() < 2) {
-               WRONG_PARAM_COUNT;
-       }
-
        ZEND_PARSE_PARAMETERS_START(2, -1)
                Z_PARAM_RESOURCE(arg1)
                Z_PARAM_STRING(format, format_len)
@@ -901,10 +897,6 @@ PHP_FUNCTION(vfprintf)
        int argc;
        zend_string *result;
 
-       if (ZEND_NUM_ARGS() != 3) {
-               WRONG_PARAM_COUNT;
-       }
-
        ZEND_PARSE_PARAMETERS_START(3, 3)
                Z_PARAM_RESOURCE(arg1)
                Z_PARAM_STRING(format, format_len)
index bfef30a75b618b8ca7cd9be622b2957369e4368d..3671300e601e07e7a644d9584a92eafeb9828599 100644 (file)
@@ -31,7 +31,7 @@ echo "Done\n";
 ?>
 --EXPECT--
 *** Testing Error Conditions ***
-Wrong parameter count for fprintf()
-Wrong parameter count for fprintf()
-Wrong parameter count for fprintf()
+fprintf() expects at least 2 parameters, 0 given
+fprintf() expects at least 2 parameters, 1 given
+fprintf() expects at least 2 parameters, 1 given
 Done
index bad7123456792a5e203077b17d3711ee6789398f..d93de7dc560b62bb96aa0fc9612513344b103263 100644 (file)
@@ -38,5 +38,5 @@ unlink( $file );
 ?>
 --EXPECT--
 -- Testing vfprintf() function with more than expected no. of arguments --
-Wrong parameter count for vfprintf()
-Wrong parameter count for vfprintf()
+vfprintf() expects exactly 3 parameters, 4 given
+vfprintf() expects exactly 3 parameters, 4 given