こんにちは、構文エラー、予期しない ':'、予期しない ','、または ')' が表示されるときは何が起こっているのでしょうか?
雨
2019-05-26 15:47:42
0
2
5367
Index.php の

[0] ParseError 行 10

構文エラー、予期しない ':'、予期しない ',' または ')'

<?phpnamespace app\index\controller ;use think\facade\Db;class Index{ public functionindex() { dump(Db::query(sql:'SELECT * FROM 'user' LIMI 1')); } public function hello($name = 'ThinkPHP6') { return 'hello,' 。 $name; }}

Index.php 行 10

の Composer\Autoload\includeFile('D:\myphp_www\PHPTuto...') の Stack

を呼び出します。 ClassLoader.php 行 322

at ClassLoader->loadClass('app\index\controller...')

at spl_autoload_call('app\index\controller...')

Controller.php 103 行目の class_exists('app\index\controller...') で

Controller.php 57 行目で Controller->controller('index') で

Dispatch.php 行 118 の Controller->exec() で

#Route.php 行 748 の Dispatch->run() で

##Route-> 行でthink\{closure}(object(Request), object(Closure), null)

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

行目ミドルウェア ->think\{closure}(object(Request)) 行 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 行 206

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

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

Middleware.php 行 206 の call_user_func_array([object(SessionInit), 'handle'], [object(Request), object(Closure), null]) で

#Middleware->think で\{closure}(object(Request)) in LoadLangPack.php 行 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 行 206

at Middleware->think\{closure}(object( Request))、CheckRequestCache.php の 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 行 206

at Middleware->think\{closure}(object(Request))

Middleware.php 行 150 の call_user_func(object(Closure), object(Request)) で ##

Route.php 755 行目のMiddleware->dispatch(object(Request))

Http.php 187 行目のRoute->dispatch(object(Request), object(Closure))

Http.php 139 行目の Http->runWithRequest(object(Request))

index.php 20 行目の Http->run()

環境変数

GET Data

/index/index

POST Dataempty

Filesempty

Cookies

PHPSESSID a334386e8fff32d2936329a874461407

pgv_pvi 4820957184

pgv_si s5068664832

thinkphp_show_page_trace 0|0

Sessionempty

サーバー/リクエストデータ

PATH C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C: \WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\インテル(R) マネジメント エンジン コンポーネント\DAL;C:\Program Files\インテル\インテル(R) マネジメント エンジン コンポーネント\DAL ;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\ bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\System32\OpenSSH\;C:\Users\gznet\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

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:/myphp_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 (Gecko のような KHTML) Chrome/ 72.0.3626.121 Safari/537.36

HTTP_UPGRADE_INSECURE_REQUESTS 1

HTTP_CACHE_CONTROL max-age=0

HTTP_CONNECTION close

HTTP_HOST tp6.io

REDIRECT_STATUS 200

FCGI_ROLE RESPONDER

PHP_SELF /index.php

REQUEST_TIME_FLOAT 1558856696.332

REQUEST_TIME 1558856696

環境変数セプティ

ThinkPHP Constantsempty

ThinkPHP V6.0.0RC1 { 十年磨一剑-API 発行设计の高性能フレーム }


致命的エラー: 捕捉されないエラー: メンバー関数の呼び出しD:\myphp_www\PHPTutorial\WWW\tp6\vendor\topthink\framework\src\think\Response.php:156 の null に対する save() スタック トレース: #0 D:\myphp_www\PHPTutorial\WWW\tp6\vendor\ topthink\framework\src\think\initializer\Error.php(55): think\Response->send() #1 [内部関数]: think\initializer\Error->appException(Object(Error)) #2 {main} が D:\myphp_www\PHPTutorial\WWW\tp6\vendor\topthink\framework\src\think\Response.php の 156 行目でスローされました

致命的エラー: キャッチされないエラー: メンバー関数の呼び出し save( ) D:\myphp_www\PHPTutorial\WWW\tp6\vendor\topthink\framework\src\think\Response.php:156 の null のスタック トレース: #0 D:\myphp_www\PHPTutorial\WWW\tp6\vendor\topthink\ Framework\src\think\initializer\Error.php(55): think\Response->send() #1 D:\myphp_www\PHPTutorial\WWW\tp6\vendor\topthink\framework\src\think\initializer\Error .php(88): think\initializer\Error->appException(Object(think\Exception\ErrorException)) #2 [内部関数]: think\initializer\Error->appShutdown() #3 {main} がスローされるD:\myphp_www\PHPTutorial\WWW\tp6\vendor\topthink\framework\src\think\Response.php 行 156


雨

全員に返信(2)
lk

dump(Db::query('SELECT * FROM `user`'));これで十分です、チュートリアルのバージョンは古すぎます

いいねを押す +0
YaoNanM

一部の文字が間違って書かれています。コードをよく確認してください

いいねを押す +0
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!