1.2.515. Has Variable Arguments

Indicates if this function or method accept an arbitrary number of arguments, based on func_get_args(), func_get_arg() and func_num_args() usage.

<?php

// Fixed number of arguments
function fixedNumberOfArguments($a, $b) {
    if (func_num_args() > 2) {
        $c = func_get_args();
        array_shift($c); // $a
        array_shift($c); // $b
    }
    // do something
}

// Fixed number of arguments
function fixedNumberOfArguments($a, $b, $c = 1) {}

?>

1.2.515.1. Specs

Short name

Functions/VariableArguments

Rulesets

All, Appinfo, CE

Exakat since

0.8.4

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Community Edition, Exakat Cloud