rfc:deprecate-bareword-strings
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:deprecate-bareword-strings [2017/02/02 21:46] – additional unaffected functionality notes imsop | rfc:deprecate-bareword-strings [2017/09/22 13:28] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Deprecate and Remove Bareword (Unquoted) Strings ====== | ====== PHP RFC: Deprecate and Remove Bareword (Unquoted) Strings ====== | ||
- | * Version: 1.0.1 | + | * Version: 1.1 |
- | * Date: 2017-01-29 | + | * Date: 2017-03-05 |
* Author: Rowan Collins rowan.collins@gmail.com | * Author: Rowan Collins rowan.collins@gmail.com | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 62: | Line 62: | ||
- In PHP 7.2, raise the severity of the message "Use of undefined constant" | - In PHP 7.2, raise the severity of the message "Use of undefined constant" | ||
- Immediately document the fallback from bareword to string as deprecated in the manual | - Immediately document the fallback from bareword to string as deprecated in the manual | ||
- | - In PHP 7.2, change the text of the message from '' | + | - In PHP 7.2, change the text of the message from '' |
- In PHP 8.0, remove the fallback, and replace the '' | - In PHP 8.0, remove the fallback, and replace the '' | ||
- | It might seem surprising to raise an '' | + | ===== E_WARNING vs E_DEPRECATED ===== |
+ | |||
+ | It might seem surprising to raise an '' | ||
* If a user is relying on the fallback to string, we should communicate that this feature is officially deprecated and slated for removal. | * If a user is relying on the fallback to string, we should communicate that this feature is officially deprecated and slated for removal. | ||
- | * If a user was actually intending to reference a constant or keyword, we should increase the chance they will see the message. | + | * If a user was actually intending to reference a constant or keyword, we should increase the chance they will see the message. |
+ | |||
+ | To make the message visible, we want to use an error level likely to be enabled both in development and production configurations. Since '' | ||
+ | |||
+ | This RFC takes the position that it is more likely that people will trigger this behaviour by mistake, so the priority is to make such a mistake obvious; thus '' | ||
+ | |||
+ | The proposed wording is also an attempt to balance these two possibilities. The use of parentheses is to avoid the awkward phrasing "in a future version of PHP in..." which would otherwise appear in the full output: | ||
- | In my opinion, the latter is more likely, and more configurations will have logging or display | + | < |
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 76: | Line 84: | ||
This change is quite deliberately a change to current behaviour. | This change is quite deliberately a change to current behaviour. | ||
- | Browsing [[https:// | + | Browsing [[https:// |
- | However, the old source code also includes the documentation with which it shipped, | + | The old source code also includes the documentation with which PHP 3 shipped, which seem to have no mention of this behaviour, and no examples which take advantage of it. |
As mentioned earlier, it has been // | As mentioned earlier, it has been // | ||
Line 98: | Line 106: | ||
===== Open Issues ===== | ===== Open Issues ===== | ||
- | * The exact text of the E_WARNING message. | ||
* Appropriate locations in the manual to document the deprecation, | * Appropriate locations in the manual to document the deprecation, | ||
Line 112: | Line 119: | ||
- | ===== Proposed | + | ===== Voting ===== |
- | A single yes/no vote requiring a 2/3 majority. | + | Voting opened on 2017-03-08, and will close on 2017-03-22 at 22:00 UTC |
- | In PHP 7.2, replace | + | The vote requires a 2/3 majority to accept |
+ | Voting is on the following proposal: | ||
+ | |||
+ | - In PHP 7.2, raise the severity of the message "Use of undefined constant" | ||
+ | - In PHP 8.0, remove the fallback, and replace the '' | ||
- | ===== Patches | + | <doodle title="Raise severity of undefined constants to E_WARNING in 7.2, and Error in 8.0?" auth=" |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
- | None yet. | ||
===== Implementation ===== | ===== Implementation ===== | ||
- | None yet. | + | * Pull Request implementing the change itself: https:// |
+ | * Merged into master: https:// | ||
+ | * Pull Request to the Language Spec documenting the new behaviour: https:// | ||
===== Rejected Features ===== | ===== Rejected Features ===== | ||
None yet. | None yet. |
rfc/deprecate-bareword-strings.txt · Last modified: 2018/03/01 23:25 by carusogabriel