diff --git a/Inline.php b/Inline.php index 04c9690c..5b5f9613 100644 --- a/Inline.php +++ b/Inline.php @@ -60,6 +60,10 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri */ public static function parse(string $value = null, int $flags = 0, array &$references = []) { + if (null === $value) { + return ''; + } + self::initialize($flags); $value = trim($value); diff --git a/Tests/InlineTest.php b/Tests/InlineTest.php index 8cd2582f..07d4e04d 100644 --- a/Tests/InlineTest.php +++ b/Tests/InlineTest.php @@ -288,6 +288,7 @@ public static function getTestsForParse() { return [ ['', ''], + [null, ''], ['null', null], ['false', false], ['true', true],