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

Fatal Error: PHP 7.4 Curly brackets deprecated. Plugin doesn't Install #223

Closed
bahiirwa opened this issue Feb 25, 2020 · 4 comments
Closed
Assignees
Labels
Has PR Issue has a PR.
Milestone

Comments

@bahiirwa
Copy link
Collaborator

bahiirwa commented Feb 25, 2020

Describe the bug
…curly brace syntax

PHP used to allow both square brackets and curly braces to be used interchangeably for accessing array elements and string offsets. The curly bracket syntax is only allowed in a limited set of cases and can be confusing for people not used to it.

PHP 7.4 will deprecate the curly brace syntax for accessing array elements and string offsets and it is expected that support will be completely removed in PHP 8.0.
Ref: https://wiki.php.net/rfc/deprecate_curly_braces_array_access

See https://core.trac.wordpress.org/ticket/47751.

I have the same issue with
includes/wc-formatting-functions.phpon line 776-778

To Reproduce
Steps to reproduce the behavior:

  1. Use a server with PHP 7.4
  2. Turn on WP_DEBUG to true
  3. Install CC
  4. Big screen error shows up. Plugin not Installed.

Screenshots
Screenshot 2020-02-25 at 09 19 13

Expected behavior

  • Plugin should install.
  • No fatal error

ClassicPress Environment
N/A

@timbocode timbocode added this to the 1.0.0-beta1 milestone Feb 25, 2020
@timbocode timbocode added the Needs PR Issue to be fixed. Needs a PR. label Feb 25, 2020
@timbocode
Copy link
Contributor

Looks like a fairly straightforward change.

$rgb['R'] = hexdec( $color{0} . $color{1} );
$rgb['G'] = hexdec( $color{2} . $color{3} );
$rgb['B'] = hexdec( $color{4} . $color{5} );

Unlikely to be a breaking change but will need manually testing and any automatic tests updating.

@bahiirwa
Copy link
Collaborator Author

PR #225 Submitted.
Travis CI passing. No breaking changes.
Tests already exist (test_wc_rgb_from_hex) in tests/unit-tests/formatting/functions.php

@timbocode
Copy link
Contributor

OK, that looks good then. 👍

@timbocode timbocode added Has PR Issue has a PR. and removed Needs PR Issue to be fixed. Needs a PR. labels Feb 25, 2020
@bahiirwa
Copy link
Collaborator Author

bahiirwa commented May 4, 2020

This issue has a merged PR #225. Needs closing @timbocode

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

No branches or pull requests

2 participants