rfc:always_enable_json
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:always_enable_json [2020/04/29 23:33] – created tandre | rfc:always_enable_json [2020/05/27 13:15] (current) – tandre | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: Your Title Here ====== | + | ====== PHP RFC: Always available JSON extension |
- | * Version: 0.1 | + | * Version: 0.3 |
- | * Date: 2020-04-29 | + | * Date: 2020-04-29 |
- | * Author: Tyson Andre | + | * Author: Tyson Andre < |
- | * Status: | + | * Status: |
* Target version: PHP 8.0 | * Target version: PHP 8.0 | ||
* Implementation: | * Implementation: | ||
Line 10: | Line 10: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | Currently, it's possible to disable the json extension with '' | + | Currently, it's possible to disable the json extension with '' |
- | However, JSON is extremely useful to have - it's widely used in many use cases (web sites, logging output, | + | However, JSON is extremely useful to have because |
and as a data format that can be used to share data with many applications | and as a data format that can be used to share data with many applications | ||
- | and programming languages), so it would be useful for PHP maintainers and users to guarantee that it's always enabled. | + | and programming languages), so it would be useful for PHP maintainers and users to guarantee that '' |
Examples of where this would be useful: | Examples of where this would be useful: | ||
- | * Allowing internal classes to implement | + | * Allowing internal classes to implement |
* Allowing PHP users to publish single-file scripts that use json_encode and json_decode and don't require polyfills or less readable var_export output. \\ | * Allowing PHP users to publish single-file scripts that use json_encode and json_decode and don't require polyfills or less readable var_export output. \\ | ||
Line 32: | Line 32: | ||
Starting in php 7.0 with the switch to jsond, it looks like licensing is no longer an issue. | Starting in php 7.0 with the switch to jsond, it looks like licensing is no longer an issue. | ||
+ | |||
+ | Extensions have been made always-on by default. For example, e.g. https:// | ||
===== Proposal ===== | ===== Proposal ===== | ||
Line 39: | Line 41: | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | The '' | + | Build configurations that contain |
- | * Libraries should check #if HAVE_JSON | + | Because JSON would always be built statically to guarantee it can be used, package maintainers for OSes such as Fedora would need to create stub packages for the '' |
- | Because JSON would always be built statically to guarantee it can be used, package maintainers for OSes such as Fedora would need to create stub packages for the '' | + | Some other installations |
- | + | ||
- | Some other OSes already use JSON statically by default (e.g. the zips published on windows.php.net, | + | |
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
8.0 | 8.0 | ||
+ | |||
+ | ===== RFC Impact ===== | ||
+ | ==== To SAPIs and Existing Extensions ==== | ||
+ | |||
+ | PECL extensions can now always rely on the '' | ||
+ | |||
+ | Minimal builds of PHP will slightly grow in size. | ||
+ | |||
+ | ===== Unaffected PHP Functionality ===== | ||
+ | |||
+ | Any already existing userland code will continue to work as before. Userland code may remove calls to '' | ||
+ | |||
+ | The '' | ||
===== Future Scope ===== | ===== Future Scope ===== | ||
- | - Start using JSON in more places within PHP's own functions. For example, adding additional conversion specifiers for '' | + | * Make internal classes that already have custom |
- | - Add alternative options to use JSON to dump debug output | + | * Start using JSON in more places within PHP's own functions. For example, adding additional conversion specifiers for '' |
- | ===== Proposed Voting Choices ===== | + | * Add alternative options to use JSON to dump debug output in an easily machine-readable form. (e.g. '' |
- | Make the JSON extension impossible to disable | + | ===== Vote ===== |
+ | |||
+ | Voting started 2020-05-13 and ends 2020-05-27. | ||
+ | |||
+ | <doodle title=" | ||
+ | | ||
+ | | ||
+ | </doodle> | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
+ | 0.3: Keep the HAVE_JSON constant in config.m4, to avoid a backwards compatibility break. | ||
===== References ===== | ===== References ===== | ||
Line 66: | Line 90: | ||
https:// | https:// | ||
+ | |||
+ | https:// |
rfc/always_enable_json.txt · Last modified: 2020/05/27 13:15 by tandre