Skip to content

Commit 9758b6c

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: Fix passing null to trim()
2 parents e23292e + c6980e8 commit 9758b6c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Inline.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri
5757
*/
5858
public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed
5959
{
60+
if (null === $value) {
61+
return '';
62+
}
63+
6064
self::initialize($flags);
6165

6266
$value = trim($value);

Tests/InlineTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ public static function getTestsForParse()
318318
{
319319
return [
320320
['', ''],
321+
[null, ''],
321322
['null', null],
322323
['false', false],
323324
['true', true],

0 commit comments

Comments
 (0)