From ecbefe18c83d6d04a0d4e4d0881efd055533a07d Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Fri, 18 Nov 2016 11:33:43 +0100 Subject: [PATCH] Work on a copy as recursion-context changes the arrays --- src/Exporter.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Exporter.php b/src/Exporter.php index 5578aa8..7f59f04 100644 --- a/src/Exporter.php +++ b/src/Exporter.php @@ -250,11 +250,12 @@ class Exporter return 'Array &' . $key; } + $array = $value; $key = $processed->add($value); $values = ''; - if (count($value) > 0) { - foreach ($value as $k => $v) { + if (count($array) > 0) { + foreach ($array as $k => $v) { $values .= sprintf( '%s %s => %s' . "\n", $whitespace,