In general, these can be some of the most difficult errors to trace because often the line number indicated in the error could be very far from the line where the actual error was made. The token list is available on this page of the official PHP documentation. Similarly, T_STRING is the token that represents a string, and so on. For example, T_VARIABLE is the token used by PHP to indicate a variable. In this case we will get unexpected T_VARIABLE because the interpreter found himself facing a variable – $ xyz – that he didn't expect.Īny error message that includes a word that begins with T_ refers to a token, that is, an internal representation of a language construct. ![]() In the example above we forgot to open the round bracket after the if. These errors are almost always the result of a typing error. Parse error: syntax error, unexpected T_IF …Īll these messages, in fact, are different examples of the same error: the PHP compiler warns us of having found a type of construct that was not expected or trusted.Parse error: syntax error, unexpected T_VARIABLE.Parse error: syntax error, unexpected T_STRING.So let check the main reasons why this happen. ![]() This error can be frustrating and take your website down. Sometimes we see the ‘Parse Error syntax error unexpected … ‘ when we edit WordPress files or we install an new theme or plugin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |