PHP: Parse Error: unexpected T_DOUBLE_ARROW

南笙酒味 提交于 2019-12-23 03:01:59

问题


My code gives me the error

Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' line 208

I keep getting this but it looks correct? Line 208 which is the second down.

array( "name" => "Colour Scheme",
 "desc" => "Select the colour scheme for the theme",
 "id" => $shortname."_color_scheme",
 "type" => "select",
 "options" => array("blue", "red", "green"),
 "std" => "blue"),

please advise!

Thanks


回答1:


T_DOUBLE_ARROW is the token for =>, so you have one which appears somewhere the parser doesn't expect it.

Besides that trailing ,, there is no error with the code you posted.




回答2:


Besides that trailing ,, there is no error with the code you posted. -- alex

Often errors can come up on a line, when the problem is actually right before it (for example missing ; at line end) -- Jonah

My bet is that Jonah is correct and that the error in the line above this array. From the context of the trailing , I bet this is a mutli-dimensional array.

If you include the code around your array I bet the problem is the line above.

Good luck.



来源:https://stackoverflow.com/questions/4847094/php-parse-error-unexpected-t-double-arrow

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!