PHPParseError: syntaxerror, unexpected $ end

Source: Internet
Author: User
Tags parse error
Php programmers may often encounter PHPParseError: syntaxerror and unexpected $ end errors. Next, I will give you a detailed summary of PHPParseError.

Php programmers may often encounter PHP Parse Error: syntax error and unexpected $ end errors. I will give you a detailed summary of the errors that cause PHP Parse Error: syntax error, unexpected $ end error cause analysis and solution.

The error is as follows:Parse error: syntax error, unexpected $ end in D: xampphtdocsguestBookguestBook. php on line 330

I checked a lot of my friends online and said it was because of php. setting short_open_tag = On in ini leads to an error. others think it has little to do with it, mainly because of the problems in your programming. for example:

  1. $ A = 1;
  2. If ($)
  3. {
  4. Echo $;
  5. }
  6. Else
  7. {

After running, the following error occurs: Parse error: syntax error, unexpected $ end in E: wwwtest. php on line 126 error. from the code above, we can see that it is caused by if {} else {} not finished. we just need to put the following code:

  1. $ A = 1;
  2. If ($)
  3. {
  4. Echo $;
  5. }
  6. Else
  7. {
  8. }

Add.

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.