Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
QuentindevePro opened this issue Aug 26, 2024 · 1 comment
Open

Comments

@QuentindevePro
Copy link

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
Copy link

cigamit commented Sep 26, 2024

I noticed this issue also. Probably happened around this time

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@cigamit @bmewburn @QuentindevePro and others