The following code is valid for php versions higher than 8.3 ([Php.watch link](https://php.watch/versions/8.3/typed-constants)). `<?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.