exec( 'Undefined variable `$key`', 'optimizer-undefined-var.php' ); } public function testGlobalsArrayAccessAllowed() { // $GLOBALS['key'] 数组访问形式应正常通过编译 $testFile = __DIR__ . '/../code/globals-array-access.php'; $compiler = CompilerTest::create(ROOT_PATH); $compiler->addFiles([$testFile]); $compiler->prepareFile($testFile); $compiler->convertFile($testFile); $this->assertTrue(true); // 无异常即通过 } }