VS Code - does not recognize php 8 syntax

Viewed 519

I have recently set up vsCode with PHP. However, it shows errors on following lines.

public static function myFunction(): bool|string

error : syntax error, unexpected '|', expecting ';' or '{'

$app->options('/{routes:.+}', fn (ResponseInterface $response) => $response);

error : syntax error, unexpected '$response' (T_VARIABLE), expecting ')'

How can I make it recognize that this is the correct syntax.

0 Answers
Related