“; PHP中的define()函数中的预期'错误,即使我已经拥有它

I am trying to make simple PHP codes and encounter this error. However, when I run test it, everything is fine.

When I try to make a constant variable using define(), I put it like this.

define('NAME', 'Yoshi');

And the error appears next to the semicolon is: '; expected'. Here is my full code.

<?php
// index.php

    define('NAME', 'Yoshi');
    $age = 30;
?>

<!DOCTYPE html> 
<html>
    <head>
        <title> my PHP </title>
    </head>

    <body>
        <h1>Something here</h1>

        <div><?php echo NAME; ?></div>
        <div><?php echo $age; ?></div>

    </body>
</html>

I tried to run VS Code as administrator and it is normal now. I really don't know the reason why, but the red line has stopped spawning in the places where there is no error.