This is an old revision of the document!
PHP RFC: Replacing current json extension with jsond
- Version: 0.1
- Date: 2015-01-01
- Author: Jakub Zelenka, bukka@php.net
- Status: Draft
Introduction
The current Json Parser in the json extension does not have a free license which is a problem for many Linux distros. The extension code is also very old which makes it difficult for further improvements. There also are some implementation decisions that makes the performance worse than it should be
Proposal
The proposal is to replace current json extension with code that is based on the PECL jsond extension (it's not exactly the same code as there are some modification for PHP 7).
Backward Incompatible Changes
- Rejected ECMA-404 and RFC 7159 incompatible number formats in json_decode string
- top level (PHP json_decode check): 07, 0xff, .1, -.1
- all (JSON_Parser): [1.], [1.e1]
Proposed PHP Version(s)
PHP 7
RFC Impact
To SAPIs
No impact
To Existing Extensions
- removed JSON_parser.h header
- removed utf8_decode.h header
- macro JSON_PARSER_DEFAULT_DEPTH renamed to PHP_JSON_PARSER_DEFAULT_DEPTH
- error codes constants moved to php_json.h
- enum error_codes renamed to php_json_error_codes (typedef)
- ext global error_code type changed from int to php_json_error_codes
To Opcache
No impact
New Constants
None
Open Issues
Not yet
Unaffected PHP Functionality
None
Future Scope
* Performance for encoder * Better error reporting (location of the error)
Proposed Voting Choices
50%+1 majority
Patches and Tests
The current patch for master can be seen at https://github.com/bukka/php-src/compare/jsond
Benchmarks will be soon available
Implementation
After the project is implemented, this section should contain
- the version(s) it was merged to
- a link to the git commit(s)
- a link to the PHP manual entry for the feature
References
...