Array and string offset access syntax with curly braces is deprecated

Created on 19 February 2021, over 3 years ago
Updated 12 October 2023, 12 months ago

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

📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇭🇺Hungary Aron Novak Hungary, Budapest

Live updates comments and jobs are added and updated live.
  • PHP 7.4

    The issue particularly affects sites running on PHP version 7.4.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇭🇺Hungary Aron Novak Hungary, Budapest

    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

  • 🇭🇺Hungary Aron Novak Hungary, Budapest
  • Status changed to Needs review over 1 year ago
  • 🇭🇺Hungary Aron Novak Hungary, Budapest
  • Status changed to RTBC 12 months ago
  • 🇺🇦Ukraine init90 Ukraine

    Thanks!

Production build 0.71.5 2024