bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.64k stars 93 forks source link

LSP: $_SERVER["argv"] is typed as ``string`` when it should be ``array`` #3031

Open QuentindevePro opened 3 months ago

QuentindevePro commented 3 months ago

According to the PHP documentation, $_SERVER["argv"] is an array, but for the Intelephense's LSP, it is typed as a string.

If you try this following code:

<?php

$argv = $_SERVER["argv"];
$cnt = count($argv);

The LSP will tell you:

Expected type 'Countable|array'. Found 'string'

Which is a false positive.

cigamit commented 2 months ago

I noticed this issue also. Probably happened around this time

## [1.11.0 - 2024-06-29] **Pre-Release**
- `$argv` is now type `string[]`.