Hallo, was passiert, wenn ein Syntaxfehler, ein unerwartetes „:', „,' oder „)' angezeigt wird?
雨
2019-05-26 15:47:42
0
2
5535

[0] ParseError in Index.php Zeile 10

Syntaxfehler, unerwartetes ':', erwartet ',' oder ')'

<?phpnamespace appindexcontroller;use thinkfacadeDb;class Index{    public function index()    {        dump (Db::query(sql:'SELECT * FROM 'user' LIMI 1'));    }    öffentliche Funktion hello($name = 'ThinkPHP6')    {        return 'hello,' . $name;    }}

Call Stack

in Index.php Zeile 10

bei ComposerAutoloadincludeFile('D:myphp_wwwPHPTuto...') in ClassLoader.php Zeile 322

bei ClassLoader->loadClass('appindexcontroller...' )

bei spl_autoload_call('appindexcontroller...')

bei class_exists('appindexcontroller...') in Controller.php Zeile 103

bei Controller->controller('index') in Controller.php Zeile 57

bei Controller->exec() in Dispatch.php Zeile 118

bei Dispatch->run() in Route.php Zeile 748

bei Route->think{closure}(object(Request), object (Closure), null)

at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php Zeile 206

at Middleware->think{closure}(object( Request)) in TraceDebug.php Zeile 48

at TraceDebug->handle(object(Request), object(Closure), null)

at call_user_func_array([object(TraceDebug), 'handle'], [object(Request ), object(Closure), null]) in Middleware.php Zeile 206

at Middleware->think{closure}(object(Request)) in SessionInit.php Zeile 58

at SessionInit->handle(object( Request), object(Closure), null)

at call_user_func_array([object(SessionInit), 'handle'], [object(Request), object(Closure), null]) in Middleware.php Zeile 206

at Middleware ->think{closure}(object(Request)) in LoadLangPack.php Zeile 60

at LoadLangPack->handle(object(Request), object(Closure), null)

at call_user_func_array([object(LoadLangPack) , 'handle'], [object(Request), object(Closure), null]) in Middleware.php Zeile 206

at Middleware->think{closure}(object(Request)) in CheckRequestCache.php Zeile 53

at CheckRequestCache->handle(object(Request), object(Closure), null)

at call_user_func_array([object(CheckRequestCache), 'handle'], [object(Request), object(Closure), null]) in Middleware.php Zeile 206

bei Middleware->think{closure}(object(Request))

bei call_user_func(object(Closure), object(Request)) in Middleware.php Zeile 150

bei Middleware->dispatch(object(Request)) in Route.php Zeile 755

bei Route->dispatch(object(Request), object(Closure)) in Http.php Zeile 187

bei Http-> ;runWithRequest(object(Request)) in Http.php Zeile 139

at Http->run() in index.php Zeile 20

Umgebungsvariablen

GET Data

/index/index    

POST Dataempty

Dateienleer

Cookies

PHPSESSID    a334386e8fff32d2936329a874461407    

pgv_pvi    4820957184    

pgv_si    s50686648 32    

thinkphp_show_page_trace    0|0    

Sessionempty

Server-/Anforderungsdaten

PATH    C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client; C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Programme (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86 )IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelWiFibin;C:Program FilesCommon FilesIntelWirelessCommon;C:WINDOWSSystem32OpenSSH;C:UsersgznetAppDataLocalMicrosoftWindowsApps    

SYSTEMROOT    C:WINDOWS    

COMSPEC    C:WINDOWSsystem32cmd .exe    

PATHEXT    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC    

WINDIR    C:WINDOWS    

PHP_FCGI_MAX_REQUESTS    1000    

PHPRC D:/myphp_www/PHPTutorial/php/php-7.2.1-nts/    

_FCGI_SHUTDOWN_EVENT_    2240    

SCRIPT_NAME    /index.php    

REQUEST_URI    /index/index    

QUERY_STRING    /index/index    

REQUEST_METHOD    GET    

SERVER_PROTOCOL    HTTP /1.1    

GATEWAY_INTERFACE    CGI/1.1    

REDIRECT_QUERY_STRING    /index/index    

REDIRECT_URL    /index/index    

REMOTE_PORT    50480    

SCRIPT_FILENAME    D:/myphp_www/PHPTutorial/WWW/tp6/public/index.php    

SERVER_ADMIN    admin@ php.cn    

CONTEXT_DOCUMENT_ROOT    D:/myphp_www/PHPTutorial/WWW/tp6/public    

CONTEXT_PREFIX    

REQUEST_SCHEME    http    

DOCUMENT_ROOT    D:/my php_www/PHPTutorial/WWW/tp6/public    

REMOTE_ADDR    127.0.0.1    

SERVER_PORT    80

SERVER_ADDR    127.0.0.1    

SERVER_NAME    tp6.io    

SERVER_SOFTWARE    Apache/2.4.23 (Win32) OpenSSL/1.0.2j mod_fcgid/2.3.9    

SERVER_SIGNATURE    

SystemRoot    C:WINDOWS   

HTTP_COOKIE    PHPSESSID=a334386e8fff32d2936329a874461407; pgv_pvi=4820957184; pgv_si=s5068664832; thinkphp_show_page_trace=0|0    

HTTP_ACCEPT_LANGUAGE    zh-CN,zh;q=0.9    

HTTP_ACCEPT_ENCODING    gzip, deflate    

HTTP_ACCEPT    text/html,application/xhtml+xml,application/xml; q=0.9,image/webp,image/ apng,*/*;q=0.8    

HTTP_USER_AGENT    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, wie Gecko) Chrome/72.0.3626.121 Safari/537.36    

HTTP_UPGRADE_INS ECURE_REQUESTS    1    

HTTP_CACHE_CONTROL    max- Alter = 0

http_connection nah

http_host tp6.io

redirect_status 200

fcgi_rol Responder Inkphp v6.0.0 RC1 { 十年磨一剑-为API开发设计的高性能框架 }

Schwerwiegender Fehler: Nicht erfasster Fehler: Aufruf einer Mitgliedsfunktion save() auf null in D:myphp_wwwPHPTutorialWWWtp6vendortopthinkframeworksrcthinkResponse.php: 156 Stack-Trace: #0 D :myphp_wwwPHPTutorialWWWtp6vendortopthinkframeworksrcthinkinitializerError.php(55): thinkResponse->send() #1 [interne Funktion]: thinkinitializerError->appException(Object(Error)) #2 {main} geworfen. in D:myphp_wwwPHPTutorialWWWtp6vendortopthinkframeworksrcthinkResponse.php online 156

Fatal Fehler: Nicht erfasster Fehler: Aufruf einer Mitgliedsfunktion save() auf null in D:myphp_wwwPHPTutorialWWWtp6vendortopthinkframeworksrcthinkResponse.php:156 Stack-Trace: #0 D:myphp_wwwPHPTutorialWWWtp6vendortopthinkframeworksrcthinkinitializerError.php(55): thinkResponse->send() #1. D:myphp_wwwPHPTutor ialWWWtp6vendortopthinkframeworksrcthinkinitializerError. php(88): thinkinitializerError->appException(Object(thinkExceptionErrorException)) #2 [interne Funktion]: thinkinitializerError->appShutdown() #3 {main} geworfen in D:myphp_wwwPHPTutorialWWWtp6vendortopthinkframeworksrcthinkResponse.php on line 156

雨

Antworte allen(2)
lk

dump(Db::query('SELECT * FROM `user`'));这样就可以了,教程上的版本太老了

YaoNanM

有字符写错,认真检查下代码

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!