From 49f384f107ea2535256ccc608dbc1ddce6939cec Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 29 Nov 2024 21:57:12 +0100 Subject: [PATCH] Use [] instead of array() to represent a constant value in compiled code --- src/Compiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compiler.php b/src/Compiler.php index 3166841e3..ce8b17c98 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -170,7 +170,7 @@ class Compiler } elseif (\is_bool($value)) { $this->raw($value ? 'true' : 'false'); } elseif (\is_array($value)) { - $this->raw('array('); + $this->raw('['); $first = true; foreach ($value as $key => $v) { if (!$first) { @@ -181,7 +181,7 @@ class Compiler $this->raw(' => '); $this->repr($v); } - $this->raw(')'); + $this->raw(']'); } else { $this->string($value); }