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
- Install PHP 7.4 or higher.
- Use the Symfony YAML Unescaper class to unescape characters in a YAML string.
- 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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | currency-php7-deprecation-3199297-2.patch | 463 bytes | leendertdb |
Comments
Comment #2
leendertdb commentedThanks 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!
Comment #3
avpadernoComment #4
aron novakIssue summary updated.
Comment #5
aron novakComment #6
aron novakComment #7
init90Thanks!