1.2.919. PHP 7.3 Last Empty Argument

PHP allows the last element of any functioncall to be empty. The argument is then not send.

This was introduced in PHP 7.3, and is not backward compatible.

The last empty line is easier on the VCS, allowing clearer text diffs.

<?php

function foo($a, $b) {
    print_r(func_get_args());
}

foo(1,
    2,
    );

foo(1);

?>

See also Allow a trailing comma in function calls and Trailing commas.

1.2.919.1. Connex PHP features

1.2.919.1.1. Specs

Short name

Php/PHP73LastEmptyArgument

Rulesets

All, Changed Behavior, CompatibilityPHP53, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56, CompatibilityPHP70, CompatibilityPHP71, CompatibilityPHP72

Exakat since

1.1.7

PHP Version

With PHP 7.3 and more recent

Severity

Critical

Time To Fix

Quick (30 mins)

Changed Behavior

PHP 7.3

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud