├── .gitignore ├── LICENSE.md ├── README.md ├── art └── github-feature.png ├── composer.json ├── composer.lock ├── phpbench.json ├── phpunit.xml ├── src ├── Parser.php ├── Token.php ├── TokenType.php ├── Tokenizer.php └── index.php └── tests ├── Benchmark ├── Datasets │ └── all.json ├── ParserBench.php └── TokenizerBench.php ├── Datasets ├── invalidJson.php ├── jsonOrgFail.php ├── jsonOrgPass.php ├── validJson.php ├── validLiterals.php └── validNumbers.php ├── Feature └── ExampleTest.php ├── JSONOrg ├── fail10.json ├── fail11.json ├── fail12.json ├── fail13.json ├── fail14.json ├── fail15.json ├── fail16.json ├── fail17.json ├── fail19.json ├── fail2.json ├── fail20.json ├── fail21.json ├── fail22.json ├── fail23.json ├── fail24.json ├── fail25.json ├── fail26.json ├── fail27.json ├── fail28.json ├── fail29.json ├── fail3.json ├── fail30.json ├── fail31.json ├── fail32.json ├── fail33.json ├── fail4.json ├── fail5.json ├── fail6.json ├── fail7.json ├── fail8.json ├── fail9.json ├── pass1.json ├── pass2.json ├── pass3.json ├── pass4.json └── pass5.json ├── Pest.php ├── TestCase.php └── Unit ├── ExampleTest.php ├── JsonOrgTest.php ├── ParseTest.php └── TokenizerTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | 3 | /.phpbench/ 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/LICENSE.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/README.md -------------------------------------------------------------------------------- /art/github-feature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/art/github-feature.png -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/composer.json -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/composer.lock -------------------------------------------------------------------------------- /phpbench.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/phpbench.json -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/phpunit.xml -------------------------------------------------------------------------------- /src/Parser.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/src/Parser.php -------------------------------------------------------------------------------- /src/Token.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/src/Token.php -------------------------------------------------------------------------------- /src/TokenType.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/src/TokenType.php -------------------------------------------------------------------------------- /src/Tokenizer.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/src/Tokenizer.php -------------------------------------------------------------------------------- /src/index.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/src/index.php -------------------------------------------------------------------------------- /tests/Benchmark/Datasets/all.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Benchmark/Datasets/all.json -------------------------------------------------------------------------------- /tests/Benchmark/ParserBench.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Benchmark/ParserBench.php -------------------------------------------------------------------------------- /tests/Benchmark/TokenizerBench.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Benchmark/TokenizerBench.php -------------------------------------------------------------------------------- /tests/Datasets/invalidJson.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Datasets/invalidJson.php -------------------------------------------------------------------------------- /tests/Datasets/jsonOrgFail.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Datasets/jsonOrgFail.php -------------------------------------------------------------------------------- /tests/Datasets/jsonOrgPass.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Datasets/jsonOrgPass.php -------------------------------------------------------------------------------- /tests/Datasets/validJson.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Datasets/validJson.php -------------------------------------------------------------------------------- /tests/Datasets/validLiterals.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Datasets/validLiterals.php -------------------------------------------------------------------------------- /tests/Datasets/validNumbers.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Datasets/validNumbers.php -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Feature/ExampleTest.php -------------------------------------------------------------------------------- /tests/JSONOrg/fail10.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/JSONOrg/fail10.json -------------------------------------------------------------------------------- /tests/JSONOrg/fail11.json: -------------------------------------------------------------------------------- 1 | {"Illegal expression": 1 + 2} -------------------------------------------------------------------------------- /tests/JSONOrg/fail12.json: -------------------------------------------------------------------------------- 1 | {"Illegal invocation": alert()} -------------------------------------------------------------------------------- /tests/JSONOrg/fail13.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot have leading zeroes": 013} -------------------------------------------------------------------------------- /tests/JSONOrg/fail14.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot be hex": 0x14} -------------------------------------------------------------------------------- /tests/JSONOrg/fail15.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \x15"] -------------------------------------------------------------------------------- /tests/JSONOrg/fail16.json: -------------------------------------------------------------------------------- 1 | [\naked] -------------------------------------------------------------------------------- /tests/JSONOrg/fail17.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \017"] -------------------------------------------------------------------------------- /tests/JSONOrg/fail19.json: -------------------------------------------------------------------------------- 1 | {"Missing colon" null} -------------------------------------------------------------------------------- /tests/JSONOrg/fail2.json: -------------------------------------------------------------------------------- 1 | ["Unclosed array" -------------------------------------------------------------------------------- /tests/JSONOrg/fail20.json: -------------------------------------------------------------------------------- 1 | {"Double colon":: null} -------------------------------------------------------------------------------- /tests/JSONOrg/fail21.json: -------------------------------------------------------------------------------- 1 | {"Comma instead of colon", null} -------------------------------------------------------------------------------- /tests/JSONOrg/fail22.json: -------------------------------------------------------------------------------- 1 | ["Colon instead of comma": false] -------------------------------------------------------------------------------- /tests/JSONOrg/fail23.json: -------------------------------------------------------------------------------- 1 | ["Bad value", truth] -------------------------------------------------------------------------------- /tests/JSONOrg/fail24.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /tests/JSONOrg/fail25.json: -------------------------------------------------------------------------------- 1 | [" tab character in string "] -------------------------------------------------------------------------------- /tests/JSONOrg/fail26.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/JSONOrg/fail26.json -------------------------------------------------------------------------------- /tests/JSONOrg/fail27.json: -------------------------------------------------------------------------------- 1 | ["line 2 | break"] -------------------------------------------------------------------------------- /tests/JSONOrg/fail28.json: -------------------------------------------------------------------------------- 1 | ["line\ 2 | break"] -------------------------------------------------------------------------------- /tests/JSONOrg/fail29.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /tests/JSONOrg/fail3.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/JSONOrg/fail3.json -------------------------------------------------------------------------------- /tests/JSONOrg/fail30.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /tests/JSONOrg/fail31.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /tests/JSONOrg/fail32.json: -------------------------------------------------------------------------------- 1 | {"Comma instead if closing brace": true, -------------------------------------------------------------------------------- /tests/JSONOrg/fail33.json: -------------------------------------------------------------------------------- 1 | ["mismatch"} -------------------------------------------------------------------------------- /tests/JSONOrg/fail4.json: -------------------------------------------------------------------------------- 1 | ["extra comma",] -------------------------------------------------------------------------------- /tests/JSONOrg/fail5.json: -------------------------------------------------------------------------------- 1 | ["double extra comma",,] -------------------------------------------------------------------------------- /tests/JSONOrg/fail6.json: -------------------------------------------------------------------------------- 1 | [ , "<-- missing value"] -------------------------------------------------------------------------------- /tests/JSONOrg/fail7.json: -------------------------------------------------------------------------------- 1 | ["Comma after the close"], -------------------------------------------------------------------------------- /tests/JSONOrg/fail8.json: -------------------------------------------------------------------------------- 1 | ["Extra close"]] -------------------------------------------------------------------------------- /tests/JSONOrg/fail9.json: -------------------------------------------------------------------------------- 1 | {"Extra comma": true,} -------------------------------------------------------------------------------- /tests/JSONOrg/pass1.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/JSONOrg/pass1.json -------------------------------------------------------------------------------- /tests/JSONOrg/pass2.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/JSONOrg/pass2.json -------------------------------------------------------------------------------- /tests/JSONOrg/pass3.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/JSONOrg/pass3.json -------------------------------------------------------------------------------- /tests/JSONOrg/pass4.json: -------------------------------------------------------------------------------- 1 | "A JSON payload should be an object or array, not a string." -------------------------------------------------------------------------------- /tests/JSONOrg/pass5.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/JSONOrg/pass5.json -------------------------------------------------------------------------------- /tests/Pest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Pest.php -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/TestCase.php -------------------------------------------------------------------------------- /tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Unit/ExampleTest.php -------------------------------------------------------------------------------- /tests/Unit/JsonOrgTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Unit/JsonOrgTest.php -------------------------------------------------------------------------------- /tests/Unit/ParseTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Unit/ParseTest.php -------------------------------------------------------------------------------- /tests/Unit/TokenizerTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielHemmati/json-parser-in-php/HEAD/tests/Unit/TokenizerTest.php --------------------------------------------------------------------------------