I had received the following error while working with the PHP WordPress -
" Parse Error: syntax error, unexpected $end in ….. scripts.php on line … "
I want to know what is the cause of this error and how/why does this error occured ?
I had received the following error while working with the PHP WordPress -
" Parse Error: syntax error, unexpected $end in ….. scripts.php on line … "
I want to know what is the cause of this error and how/why does this error occured ?
unexpected $end indicates that you have probably missed to close a conditional - } in your php script. check your php script keenly and put the required conditional - } at the proper location.
The php wordpress error which you have mentioned may occur due to many reasons -
- It may be a cause of missing curly bracket ( } ) in PHP script coding.
- It may be also caused due to class definition error in PHP coding.
In PHP, a class definition cannot be broke up and distributed into multiple files, or into multiple PHP blocks, unless the break is within a method declaration.
- But more commonly, the error is caused by the use of Short Open tags in PHP,
To use short open tags, it must be enabled in PHP.INI. Search for short_open_tag in PHP.INI, and change the value to On, like
short_open_tag = On
Bookmarks