Problem/Motivation

The current code in the Symfony YAML Unescaper class is not compatible with PHP 7.4 due to the use of curly braces for string offset access. This has been deprecated in PHP 7.4 and will result in errors when running the code on newer PHP versions.

Steps to reproduce

  1. Install PHP 7.4 or higher.
  2. Use the Symfony YAML Unescaper class to unescape characters in a YAML string.
  3. Observe the deprecated error caused by the use of curly braces for string offset access.

Proposed resolution

Update the code in the Symfony YAML Unescaper class to replace the deprecated curly braces with square brackets for string offset access, as shown in the provided patch.

Remaining tasks

  • Review and apply the provided patch.
  • Run tests to ensure compatibility with PHP 7.4 and higher.

User interface changes

None

API changes

None

Data model changes

None

Comments

Aron Novak created an issue. See original summary.

leendertdb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new463 bytes

Thanks for the patch Aron Novak. We had the same issue, after I applied the patch I can confirm the error no longer appears.

To clarify the issue for others: Using PHP 7.4 the currency module throws an error in some cases when the affected code in the patch is executed. By replacing the curly braces by normal braces for the array accessor the PHP 7.4 compatibility issue is solved.

I changed the patch name to include the issue ID and comment number for better readability.

RTBC!

avpaderno’s picture

Assigned: aron novak » Unassigned
Status: Reviewed & tested by the community » Needs work
Issue tags: -php7.4 +PHP 7.4, +Needs issue summary update
aron novak’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Issue summary updated.

aron novak’s picture

Issue summary: View changes
aron novak’s picture

Status: Needs work » Needs review
init90’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!