Home >Backend Development >PHP Tutorial >phpStorm When I create a new php file and write something, there is a red line prompting Expecting Statement. How to solve it?

phpStorm When I create a new php file and write something, there is a red line prompting Expecting Statement. How to solve it?

WBOY
WBOYOriginal
2016-08-20 09:04:102958browse

When you create a new php file in phpStorm and write something, there will be a red line prompting Expecting Statement. There is no error found in the method. If you write an empty method, there will be a red line. Have you ever encountered this problem? How to solve itphpStorm When I create a new php file and write something, there is a red line prompting Expecting Statement. How to solve it?

phpStorm When I create a new php file and write something, there is a red line prompting Expecting Statement. How to solve it?

Reply content:

When you create a new php file in phpStorm and write something, there will be a red line prompting Expecting Statement. There is no error found in the method. If you write an empty method, there will be a red line. Have you ever encountered this problem? How to solve itphpStorm When I create a new php file and write something, there is a red line prompting Expecting Statement. How to solve it?

phpStorm When I create a new php file and write something, there is a red line prompting Expecting Statement. How to solve it?

Remove public, because public is the way to write it in class

Screenshots and code are for the full version. . .

You did write public wrong here, but please note that sometimes phpstorm will show some inexplicable prompts, but after you cut and paste the code, it will be fine, so you still can’t trust the IDE too much, haha

Don’t worry too much about error messages, sometimes it’s just the IDE having trouble!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn