Vscode-intelephense: Error with PHP 7.4 typed properties

Created on 22 Jan 2020  路  4Comments  路  Source: bmewburn/vscode-intelephense

Describe the bug
Error is being show for PHP typed properties - I thought that with v 1.3x PHP 7.4 is fully supported
To Reproduce
A code snippet (NOT a screenshot of a code snippet) or steps to reproduce the issue

class User {

    public string $name;

   public int $age;

   public function __construct(string $name, int $age)
   {
         $this->name = $name;
         $this->age = $age;
    }
}

Expected behavior
With PHP 7.4 typed properties should not show red error lines

Screenshots
If applicable, add screenshots to help explain your problem.

Screenshot 2020-01-22 at 18 30 10

Platform and version
OS and Intelephense version.
Os: macOS: 10.15.2
Intelephense: 1.3.7

Most helpful comment

Sorry my bad. I had accidentally enabled built-in PHP validation in settings. Turning it off makes the error go away.

So seems the error was from built-in PHP validation and not intelephense.

Sorry and Thanks.

All 4 comments

Are you sure this error is from intelephense? Can you copy error from problems tab ctrl+shift+m?

Sorry my bad. I had accidentally enabled built-in PHP validation in settings. Turning it off makes the error go away.

So seems the error was from built-in PHP validation and not intelephense.

Sorry and Thanks.

Sorry my bad. I had accidentally enabled built-in PHP validation in settings.

It's working fine with php 7.4 path in "php.validate.executablePath"

Thanks @KapitanOczywisty
I upgraded to PHP 7.4 but didn't realise that I have not changed the "php.validate.executablePath" - cause I had disabled it after installing intelephense.

Now changing it path to point to PHP 7.4 and enabling "built-in vlaidation" works and there's no error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zlianon picture zlianon  路  4Comments

zlianon picture zlianon  路  3Comments

9brada6 picture 9brada6  路  3Comments

steven7mwesigwa picture steven7mwesigwa  路  4Comments

ottopic picture ottopic  路  3Comments