Skip to content

False positive: debug_backtrace(), no longer report the original value #796

@MarkMaldaba

Description

@MarkMaldaba

I've just had the following error reported:

78 | WARNING | Since PHP 7.0, functions inspecting arguments, like debug_backtrace(), no longer report the original
   |         | value as passed to a parameter, but will instead provide the current value. The parameter "$ErrorType"
   |         | was used, and possibly changed (by reference), on line 62.

Line 62 is as follows:

if ($ErrorType === null) {

This is a comparison, not an assignment, so it looks like the sniff is getting it wrong. I would naively assume it's detecting $Var = without considering the additional = symbols, but as the parsing is normally token based, it may not be something so obvious.

Or am I misunderstanding something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions