Skip to content

Typed class constants are shown as invalid in PHP 8.3 #82

@Kaylen7

Description

@Kaylen7

The following code is valid for php versions higher than 8.3 (Php.watch link).

`<?php

class Test {
const string FOO = 'test';
public function print(){
echo self::FOO;
}
}

$test = new Test();
$test->print();`

VSCode IntelliSense extension underlines string (l.4) and the error message says that '=' is expected as it takes type as the name of the constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions