Skip to content

Commit

Permalink
Allow parsing 0 as valid json, fixes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jun 18, 2017
1 parent baa9092 commit 04fc1ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Seld/JsonLint/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private function next()
if ($this->done) {
return $this->EOF;
}
if (!$this->input) {
if ($this->input === '') {
$this->done = true;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/JsonParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class JsonParserTest extends PHPUnit_Framework_TestCase
'["http:\/\/foo\\\\zomg"]',
'{"":"foo"}',
'{"a":"b", "b":"c"}',
'0',
'""',
);

/**
Expand Down

0 comments on commit 04fc1ff

Please sign in to comment.