我有兩個文件:PHP命名空間回落至全球使用可變不工作
的index.php
$a = "a";
namespace.php
namespace tom\anderson\s;
include 'index.php';
echo \$a;
這不起作用並輸出錯誤消息:Parse error: syntax error, unexpected '$a' (T_VARIABLE), expecting identifier (T_STRING) in...
這是爲什麼?任何對官方文檔的引用都會有幫助!