-
-
Notifications
You must be signed in to change notification settings - Fork 205
False positive func_get_args() - return statement #1240
Copy link
Copy link
Closed
Milestone
Description
Hi,
As briefly discussed in vip-go-mu-plugins issue. We have a false positive warning with the following error msg:
Since PHP 7.0, functions inspecting arguments, like func_get_args(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "$stuff" was used, and possibly changed (by reference), on line 7.
The sample code that generates this warning:
<?php
$condition = true;
function foo( $stuff ) {
if ( $condition ) {
return $stuff;
}
func_get_args();
}
The return statement is not changing a parameter therefore should not be considered an issue if I understand correctly.
Reactions are currently unavailable