Skip to content

Commit

Permalink
minor #4486 Use [] instead of array() to represent a constant value i…
Browse files Browse the repository at this point in the history
…n compiled code (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Use [] instead of array() to represent a constant value in compiled code

Commits
-------

49f384f Use [] instead of array() to represent a constant value in compiled code
  • Loading branch information
fabpot committed Nov 30, 2024
2 parents 3eed037 + 49f384f commit 101d181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function repr($value)
} 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) {
Expand All @@ -181,7 +181,7 @@ public function repr($value)
$this->raw(' => ');
$this->repr($v);
}
$this->raw(')');
$this->raw(']');
} else {
$this->string($value);
}
Expand Down

0 comments on commit 101d181

Please sign in to comment.