Understanding php parsing error parseerror

Source: Internet
Author: User
Tags php debugger
Programming is inevitable. The key is how to solve the error. In fact, php error prompts are very clear in the future. Generally, you will be prompted for the row number and error level. you can use error_reporting () function to control the error level. if this is not enough, install the php debugger.

Programming is inevitable. The key is how to solve the error. In fact, php error prompts are very clear in the future. Generally, you will be prompted for the row number and error level. you can use error_reporting () function to control the error level. if this is not enough, install the php debugging tool x-Debug. in today's php Tutorial, let's talk about the principles and solutions of the php parsing error parse error:

1. for example, the following php code:


 

This is because the second line is missing; an error occurs, but the display is:

(! ) Parse error: syntax error, unexpected T_IF in F: \ web \ zend \ exercise \ test. php on line3

But it is the third line, so parsing errors is very troublesome, because you do not know which line is actually wrong.

2. check the following php code:


 

Due to the lack of} to end a function, the following error occurs:

(! ) Parse error: syntax error, unexpected $ end in F: \ web \ zend \ exercise \ test. php on line5

3. php pre-defined words cannot be assigned to a value, such as while and function. Otherwise, the following error occurs:

(! ) Parse error:, unexpected T_WHILE in

These common errors are easy to avoid. all you need is a powerful editor, such as Zend Studio and Eclipse for php. In addition, 10 excellent php development tools are recommended!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.