Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Minifier Causes Parse Error #1

Closed
taufik-nurrohman opened this issue Oct 16, 2021 · 1 comment
Closed

PHP Minifier Causes Parse Error #1

taufik-nurrohman opened this issue Oct 16, 2021 · 1 comment
Labels

Comments

@taufik-nurrohman
Copy link
Member

taufik-nurrohman commented Oct 16, 2021

[16-Oct-2021 12:18:44 UTC] PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in .\lot\x\panel\engine\f\route.php on line 15

PHP Version: 7.2.7

On line 15 of .\lot\x\panel\engine\f\route.php is a HEREDOC syntax:

$content=<<<S
Stuff goes here.
S;$_['title']='Etc...';

Adding a line break just after the ; fixed the issue:

$content=<<<S
Stuff goes here.
S;
$_['title']='Etc...';
@taufik-nurrohman
Copy link
Member Author

HA! Just found the spec for older PHP version:

Prior to PHP 7.3.0, it is very important to note that the line with the closing identifier must contain no other characters, except a semicolon (;). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon. It's also important to realize that the first character before the closing identifier must be a newline as defined by the local operating system. This is \n on UNIX systems, including macOS. The closing delimiter must also be followed by a newline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant