Skip to content

False positive func_get_args() - return statement #1240

@pschoffer

Description

@pschoffer

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions