]> granicus.if.org Git - php/commitdiff
Remove explicit params count check
authorGabriel Caruso <carusogabriel34@gmail.com>
Sun, 18 Feb 2018 02:11:00 +0000 (23:11 -0300)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 19 Feb 2018 12:56:30 +0000 (13:56 +0100)
Relying on ZPP instead. Also, use ZEND_NUM_ARGS() instead of hardcode
number of parameters

ext/mysqli/mysqli_warning.c

index e0d9d7abdf2cfcde216c7986368af77c39a34b54..0ff46ec7f925ebb578a6a80eca21ef9a468485a0 100644 (file)
@@ -256,10 +256,7 @@ PHP_METHOD(mysqli_warning, __construct)
        MYSQLI_WARNING  *w;
        MYSQLI_RESOURCE *mysqli_resource;
 
-       if (ZEND_NUM_ARGS() != 1) {
-               WRONG_PARAM_COUNT;
-       }
-       if (zend_parse_parameters(1, "o", &z)==FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &z) == FAILURE) {
                return;
        }
        obj = Z_MYSQLI_P(z);