btw I'm using PHP 8.1.8, though the extension reports on the Statusbar as I'm using 8.0 (when it's not true):

    Ok issue identified on the "php.executables" paths config mapping, this is what I've currently:

    {
        "php.executables": {
            "system": "/usr/local/bin/php",
            "8.1": "/usr/local/bin/Cellar/php/8.1.8/bin/php"
        }
    }

    When using "system" its reporting it as PHP 8.0 when its the one linked by Homebrew (using OS X) so being the same as the one below mapped as 8.1, but when I swap to the 8.1 the problem dissapear

    tl;dr

    Issue is with the VSCode extension detecting the PHP runtime version properly (maybe running php -v once to detect this then analyse the workspace problems?)

      5 days later

      JakubMisek Yes, I am using 8.1.8 as the php -v is displaying

        Ok only selecting that 8.1, it's just detecting the version by the name so I had that system that the extension believed was PHP 8.0 but it was 8.1

        Solved by just using one version with "8.1" as a key

        "php.executables": {
                "8.1": "/usr/local/bin/php"
            }

          d8vjork You should be able to select the "system" profile, and PHP Tools will run php -v and resolve the actual version:

            Ok yes, its solved, I don't know how sometimes it went PHP 8.0 when I don't even have it (maybe its an external problem, from Brew linking stuff)

            Anyway thank you again @JakubMisek

              that's weird - by default, the editor assumes PHP 8.1 (latest), or it takes the first PHP you have as the default ...

              we should review how it works ...

                JakubMisek Yeah, will try more as I've plenty of instances of VSCode always open on my Macbook, all of them using PHPTools by default

                  Write a Reply...