← Custom Sidebar

Oh my T_CASE!

A little explanation. Does anyone out there program in PHP? If you do (woohoo!), you may have experienced a:

Parse error: syntax error, unexpected T_CASE in /path/to/file on line 7

Or perhaps, maybe a:

Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /path/to/file on line 12

Or maybe even a:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /path/to/file on line 12

No need to panic. Well, I guess I did the first time I saw one of them. But it turns out that, while it is hard to find information about them on the internet, the solution for them is quite simple.

They just mean that you're using bad syntax. For instance, the T_CASE may mean that you have a switch statement somewhere and forgot a ; after the break. The T_ECHO could mean that you forgot a ; after an echo statement. And the what-on-earth T_CONSTANT_ENCAPSED_STRING just means that you left out a ['s matching ].

That feel better? I knew it would.

Sorry, I'm just really random sometimes, but it WAS difficult to find information about these errors on the internet.

Hatkirby on
👍 1 👎

Comments

Replying to comment by :
Feel free to post a comment! You may use Markdown.