diff --git a/Inline.php b/Inline.php index 8a7e9144..a1a76534 100644 --- a/Inline.php +++ b/Inline.php @@ -57,6 +57,10 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri */ public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed { + if (null === $value) { + return ''; + } + self::initialize($flags); $value = trim($value); diff --git a/Tests/InlineTest.php b/Tests/InlineTest.php index e5da4c22..93a05153 100644 --- a/Tests/InlineTest.php +++ b/Tests/InlineTest.php @@ -318,6 +318,7 @@ public static function getTestsForParse() { return [ ['', ''], + [null, ''], ['null', null], ['false', false], ['true', true],