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 7.1 syntax for array destructuring doesn't work on PHP 7.0 #1262

Closed
OldStarchy opened this issue Feb 4, 2020 · 2 comments
Closed

PHP 7.1 syntax for array destructuring doesn't work on PHP 7.0 #1262

OldStarchy opened this issue Feb 4, 2020 · 2 comments
Labels

Comments

@OldStarchy
Copy link

OldStarchy commented Feb 4, 2020

Description

The new syntax for array destructuring is used here

[$field, $direction] = explode('|', $sort);

However this requires PHP >= 7.1 and is an unexpected breaking change. I guess this was an unintentional change due to php-cs-fixer based on the commit message 9a8c556

Fix usage for htmlspecialchars

The minimum required version of PHP should be specified in the composer.json so we don't accidentally install an incompatible version.

Steps to reproduce

  1. Install craft commerce 3.0.5 on a PHP 7.0 server
  2. Navigate to the commerce tab in the CP

Additional info

  • Craft version: 3.4.2
  • PHP version: 7.0.33
  • Database driver & version: N/A
  • Plugins & versions: Commerce 3.0.5
@OldStarchy
Copy link
Author

This happens in all versions >= 3

$ git tag --contains 9a8c556c898dcdce1d3fa24f0a5814b31d33d3fa
3.0.0
3.0.0-RC1
3.0.1
3.0.2
3.0.3
3.0.4
3.0.5

@nfourtythree
Copy link
Contributor

Hi @aNickzz

Thanks for pointing this out. A fixed has been pushed and will be included in the next release.

Thanks!

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

2 participants