var_export does not handle circular references

Created on 10 February 2025, 21 days ago

Problem/Motivation

The usage of var_export does not allow circular references. This means that if a class is added as part of the $key or $value variables, the site is very likely gonna get an "500 Internal Server Error" as it runs out of memory.
An example could be Drupal\Core\StringTranslation\TranslatableMarkup .

Proposed resolution

A solution could be to use json_encode or Symfony VarDumper instead of var_export

User interface changes

None.

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

2.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024