rfc:json_throw_on_error
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:json_throw_on_error [2017/09/10 01:19] – fix status ajf | rfc:json_throw_on_error [2017/10/22 18:44] (current) – implement ajf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: JSON_THROW_ON_ERROR ====== | ====== PHP RFC: JSON_THROW_ON_ERROR ====== | ||
- | * Version: 1.0 | + | * Version: 1.0.2 |
* Date: 2017-09-10 | * Date: 2017-09-10 | ||
* Author: Andrea Faulds | * Author: Andrea Faulds | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 9: | Line 9: | ||
PHP has two functions for dealing with JSON, < | PHP has two functions for dealing with JSON, < | ||
- | This situation is suboptimal, and throwing exceptions would be cleaner: there would be no confusion between error values and correct results, no (possibly outdated) global state, no program execution after the error is thrown unless explicitly handled, and error messages would be neatly traceable to their source. However, to immediately change the default behaviour of these functions would be a backwards-compatibility issue. | + | This situation is suboptimal, and throwing exceptions would be cleaner: there would be no confusion between error values and correct results, no (possibly outdated) global state, no program execution after the error is thrown unless explicitly handled, and error messages would be neatly traceable to their source. However, to immediately change the default behaviour of these functions |
===== Proposal ===== | ===== Proposal ===== | ||
- | This RFC instead proposes adding a new option flag value for < | + | This RFC instead proposes adding a new option flag value for < |
< | < | ||
- | At the present time, there would be no change to the default error behaviour. It would be worthwhile considering whether to eventually deprecate not using < | + | Note that when given an invalid depth parameter, < |
+ | |||
+ | At the present time, there would be no change to the default error behaviour. It would be worthwhile considering whether to eventually | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 40: | Line 42: | ||
As mentioned earlier, it may be desirable to deprecate the default behaviour eventually. | As mentioned earlier, it may be desirable to deprecate the default behaviour eventually. | ||
- | ===== Proposed Voting Choices | + | ===== Vote ===== |
- | This is not a language change, merely a small addition to the JSON extension, so it only technically requires a 50%+1 majority. | + | This is not a language change, merely a small addition to the JSON extension, so it only technically requires a 50%+1 majority. However, it's a 2/3 vote. It is a simple Yes/No vote on whether to accept this RFC and merge the patch. |
- | It would be a simple Yes/No vote on whether to accept this RFC and merge the patch. | + | Voting started 2017-09-25 and ended 2017-10-05. |
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
Line 49: | Line 56: | ||
===== Implementation ===== | ===== Implementation ===== | ||
+ | |||
+ | Merged in PHP 7.3: https:// | ||
+ | |||
After the project is implemented, | After the project is implemented, | ||
- | - the version(s) it was merged to | ||
- | - a link to the git commit(s) | ||
- a link to the PHP manual entry for the feature | - a link to the PHP manual entry for the feature | ||
- | - a link to the language specification section (if any) | ||
===== References ===== | ===== References ===== | ||
Line 63: | Line 70: | ||
===== Rejected Features ===== | ===== Rejected Features ===== | ||
Keep this updated with features that were discussed on the mail lists. | Keep this updated with features that were discussed on the mail lists. | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
+ | * v1.0.2 - change behaviour to leave global error flag untouched, rather than clearing it; note depth, param-parsing errors | ||
+ | * v1.0.1 - cover details of the patch not previously mentioned | ||
+ | * v1.0 - initial version |
rfc/json_throw_on_error.1505006353.txt.gz · Last modified: 2017/09/22 13:28 (external edit)