PHP: Parse Error: unexpected T_DOUBLE_ARROW

2019-06-11 22:53发布

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

2条回答
再贱就再见
2楼-- · 2019-06-11 23:32

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.

查看更多
迷人小祖宗
3楼-- · 2019-06-11 23:39

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.

查看更多
登录 后发表回答