When I test an easy PHP program , I found that there is a strange problem. The code is in fllow:
<?php
$a = "abc";
function Test()
{
global $a;
$b .= $a."e";
return $b;
}
echo Test();
As I know,it is legal.But Visual Studio Code tells me that the $b is Undefined variable.
At the same time, the program can run successfully with the output:abce
Anybody can help me? I want to know the reason.