Skip to content

Commit fec0dfc

Browse files
committed
PrintContext::format() removes null value used in %dump?
1 parent b3e2f7f commit fec0dfc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Latte/Compiler/PrintContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function ($m) use ($args) {
133133
'line' => $arg?->line ? "/* line $arg->line" . ($arg->column ? ":$arg->column" : '') . ' */' : '',
134134
};
135135

136-
if ($cond && ($code === '[]' || $code === '')) {
136+
if ($cond && ($code === '[]' || $code === '' || $code === 'null')) {
137137
return $right ? $left : $right;
138138
}
139139

tests/common/PrintContext.format().phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ test('%dump', function () {
5656
);
5757

5858
Assert::same(
59-
"test('hello', null)",
60-
format('test(%dump, %dump?)', 'hello', null),
59+
"test('hello')",
60+
format('test(%dump, %dump?, %dump?)', 'hello', [], null),
6161
);
6262

6363
Assert::match(

0 commit comments

Comments
 (0)