Skip to content

use older php array syntax in index.php#1661

Merged
LukasReschke merged 1 commit intomasterfrom
fix_1659
Oct 8, 2016
Merged

use older php array syntax in index.php#1661
LukasReschke merged 1 commit intomasterfrom
fix_1659

Conversation

@georgehrke
Copy link
Member

We should use the old array syntax in the index.php, because the shorthand version was introduced with PHP 5.4.
Users with an older PHP will only see an error message about the Syntax error in the index.php

fixes #1659

please review @MorrisJobke @nickvergessen @fancycode

@georgehrke georgehrke added the 3. to review Waiting for reviews label Oct 7, 2016
@mention-bot
Copy link

@georgehrke, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975, @owncloud-bot and @LukasReschke to be potential reviewers.

@rullzer
Copy link
Member

rullzer commented Oct 7, 2016

Why? we don't support it.

@georgehrke
Copy link
Member Author

Yes, we don't support it.
But if we use this [] syntax, 5.3 won't even know, that we only support 5.6+.
They'll only see an HTTP 500

@nickvergessen
Copy link
Member

I don't really care. Either way is fine for me. We could also add the exact parse error in our docs, so it has a hint on google...

@rullzer
Copy link
Member

rullzer commented Oct 8, 2016

mmm fine by me. But it will fail at some point in the future when somebody modifies base.php again.

@georgehrke
Copy link
Member Author

mmm fine by me. But it will fail at some point in the future when somebody modifies base.php again.

I don't think so. As long as this check kicks on, base.php won't even be included.

if (version_compare(PHP_VERSION, '5.6.0') === -1) {

My point is, that the user won't even see:

This version of Nextcloud requires at least PHP 5.6.0<br/>
You are currently running ' . PHP_VERSION . '. Please update your PHP version.

when running on PHP5.3 or earlier, because php isn't even able to parse the index.php

@LukasReschke
Copy link
Member

LGTM

@LukasReschke LukasReschke merged commit 90cb3e3 into master Oct 8, 2016
@LukasReschke LukasReschke deleted the fix_1659 branch October 8, 2016 16:44
@MorrisJobke MorrisJobke added this to the Nextcloud 11.0 milestone Oct 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"PHP Parse error: syntax error" with PHP 5.3.10

6 participants