[php-src] Issue #8456: var_export falls into infinite loop

From: Date: Fri, 29 Apr 2022 00:16:04 +0000
Subject: [php-src] Issue #8456: var_export falls into infinite loop
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241308@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8456
Author: chx

### Description

I wish I had simple reproduction instructions but I don't. I can repro this Drupal, run this
with bash:
```
composer create-project drupal/recommended-project var-export
cd var-export
composer require drush/drush
drush -y si --db-url=sqlite://.test.db minimal
cat > web/bug.php << 'EOD'
<?php

$twig = \Drupal::service('twig');
$string = '{{ foobar ]}';
$stream = $twig->tokenize(new \Twig\Source($string, '{# inline_template_start #}'));
$nodes = $twig->parse($stream);
$twig->compile($nodes);
print $nodes;
EOD
drush scr bug.php
```

Ends up with  [warning] var_export does not handle circular references Node.php:56
infinitely.

Maybe connect var_export to the garbage collector since that knows about circular references...? I
have no idea what I am talking about, though.

### PHP Version

PHP 8.0.17

### Operating System

_No response_


Thread (1 message)

  • chx
« previous php.bugs (#241308) next »