C
C
camradee2019-11-12 11:34:13
PHP
camradee, 2019-11-12 11:34:13

Why did the error "Parse error: syntax error, unexpected end of file" appear when changing from php5 to php7?

They asked to make very small design changes in the ancient php legacy: 5.6.31, the site was not only written 15 years ago, but also without a hint of MVC - inserts - <?php ... ?> more html. Downloaded the latest XAMPP with php7 and got this error. To understand where there is something that is not closed for a long time and is inexpedient, the question is actually why did it appear? After all, on php5.6 the site works without errors. Googled the difference between version 5 and 7, but did not find the answer. What is the trouble and how can you quickly fix it without digging into the code?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
green_goo, 2019-11-12
@camradee

Most likely due to disabled short_tags

A
Antonio Solo, 2019-11-12
@solotony

this error appears when some language construction is not closed (brackets {} or something else)
look for an error - there is no other option.
"why it didn't appear in the 5th version" - because formally these are different languages ​​and they don't have backward compatibility, and in particular because the error handling scheme has been changed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question