#0 [0]ParseError in Index.php line 12

语法错误: unexpected token "}", expecting ";"

  1. namespace app\controller;
  2. use app\BaseController;
  3. class Index extends BaseController
  4. {
  5. public function index()
  6. {
  7. return "HELLO"
  8. }
  9. public function hello($name = 'ThinkPHP8')
  10. {
  11. return 'hello,' . $name;
  12. }
  13. }

Call Stack

  1. in Index.php line 12
  2. at Composer\Autoload\{closure}() in ClassLoader.php line 427
  3. at ClassLoader->loadClass()
  4. at class_exists() in Controller.php line 186
  5. at Controller->controller() in Controller.php line 74
  6. at Controller->exec() in Dispatch.php line 52
  7. at Dispatch->run() in Route.php line 755
  8. at Route->think\{closure}() in Pipeline.php line 59
  9. at Pipeline->think\{closure}() in Pipeline.php line 66
  10. at Pipeline->then() in Route.php line 756
  11. at Route->dispatch() in Http.php line 208
  12. at Http->dispatchToRoute() in Http.php line 198
  13. at Http->think\{closure}() in Pipeline.php line 59
  14. at Pipeline->think\{closure}() in TraceDebug.php line 71
  15. at TraceDebug->handle()
  16. at call_user_func() in Middleware.php line 134
  17. at Middleware->think\{closure}() in Pipeline.php line 85
  18. at Pipeline->think\{closure}() in Pipeline.php line 66
  19. at Pipeline->then() in Http.php line 199
  20. at Http->runWithRequest() in Http.php line 162
  21. at Http->run() in index.php line 20

Environment Variables

GET Data
thread-create-3_htm
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
PATH C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;
SYSTEMROOT C:\Windows
COMSPEC C:\Windows\system32\cmd.exe
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR C:\Windows
PHPRC C:/phpstudy_pro/Extensions/php/php8.0.2nts
_FCGI_SHUTDOWN_EVENT_ 9212
HTTP_CONNECTION close
SCRIPT_NAME /index.php
REQUEST_URI /?thread-create-3.htm
QUERY_STRING thread-create-3.htm
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REMOTE_PORT 53724
SCRIPT_FILENAME C:/phpstudy_pro/WWW/damihu.net/public/index.php
SERVER_ADMIN admin@example.com
CONTEXT_DOCUMENT_ROOT C:/phpstudy_pro/WWW/damihu.net/public
CONTEXT_PREFIX
REQUEST_SCHEME http
DOCUMENT_ROOT C:/phpstudy_pro/WWW/damihu.net/public
REMOTE_ADDR 3.141.24.134
SERVER_PORT 80
SERVER_ADDR 172.17.50.158
SERVER_NAME 23o.net
SERVER_SOFTWARE Apache/2.4.39 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02
SERVER_SIGNATURE
SystemRoot C:\Windows
HTTP_HOST 23o.net
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1713454518.9216
REQUEST_TIME 1713454518
0.032034s