eclipse-pdt / pdt

PHP Development Tools project (PDT)
https://eclipse.org/pdt
Eclipse Public License 2.0
188 stars 46 forks source link

$argc and $argv as function arguments: error #252

Closed mlocati closed 9 months ago

mlocati commented 10 months ago

Describe the bug

When using $argc and/or $argv as argument names of a function, PDT reports this errors:

Cannot re-assign auto-global variable $argc
Cannot re-assign auto-global variable $argv

Describe the eclipse environment Eclipse 2023-09, PDT 8.2.0.202309191936

Describe your system

To Reproduce

Cleate a PHP file like this:

<?php

function foo($argc, $argv)
{
}

Both $argc and $argv highlighed by PDT as if they were errors, and in the Problems view we have:

Description                                  Location  Type
Cannot re-assign auto-global variable $argc  line 3    PHP Problem
Cannot re-assign auto-global variable $argv  line 3    PHP Problem

Expected behavior

Using $argc and $argv as function argument names is absolutely legal (see for example https://3v4l.org/5NNlA and compare it with https://3v4l.org/deaY6).