rfc:unicode_escape

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:unicode_escape [2014/12/10 19:53] – v0.1.3 - ''\u'' without a following opening ''{'' passes through verbatim ajfrfc:unicode_escape [2014/12/19 00:52] – Implemented ajf
Line 3: Line 3:
   * Date: 2014-11-24, Last Updated 2014-12-08   * Date: 2014-11-24, Last Updated 2014-12-08
   * Author: Andrea Faulds, ajf@ajf.me   * Author: Andrea Faulds, ajf@ajf.me
-  * Status: In Voting+  * Status: Implemented (PHP 7.0)
   * First Published at: http://wiki.php.net/rfc/unicode_escape   * First Published at: http://wiki.php.net/rfc/unicode_escape
  
Line 79: Line 79:
 This change would take place in a major version, so some level of backwards-compatibility breakage would be justified. In cases where it caused problems with existing code, fixing it could be done quite trivially by either switching to single-quoted strings, or escaping the backslash. This change would take place in a major version, so some level of backwards-compatibility breakage would be justified. In cases where it caused problems with existing code, fixing it could be done quite trivially by either switching to single-quoted strings, or escaping the backslash.
  
-In order to reduce backwards-compatibility issues, particularly with JSON in string literals, ''\u'' which is not followed by an opening ''{'' will pass through verbatim (instead of being interpreted as an escape sequence) and not raise an error. This means that existing code like 'json_decode("\"\u202e\"");'' will continue to work properly. On the other hand, ''"\u{foobar"'' will raise an error.+In order to reduce backwards-compatibility issues, particularly with JSON in string literals, ''\u'' which is not followed by an opening ''{'' will pass through verbatim (instead of being interpreted as an escape sequence) and not raise an error. This means that existing code like ''json_decode("\"\u202e\"");'' will continue to work properly. On the other hand, ''"\u{foobar"'' will raise an error.
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 97: Line 97:
 As this is a language change, a 2/3 majority would be required. As this is a language change, a 2/3 majority would be required.
  
-Voting started on 2014-12-08 and ends on 2014-12-18.+Voting started on 2014-12-08 and ended on 2014-12-18.
  
-<doodle title="Accept the Unicode Codepoint Escape Syntax RFC and merge into master?" auth="ajf" voteType="single" closed="false">+<doodle title="Accept the Unicode Codepoint Escape Syntax RFC and merge into master?" auth="ajf" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 110: Line 110:
 A language specification pull request with a patch and tests can be found here: https://github.com/php/php-langspec/pull/92 A language specification pull request with a patch and tests can be found here: https://github.com/php/php-langspec/pull/92
  
-Provisional HHVM implementation (includes name support): https://github.com/sgolemon/hhvm/compare/unicode-escape+Provisional HHVM implementation: https://reviews.facebook.net/D30153
  
 ===== Implementation ===== ===== Implementation =====
-After the project is implemented, this section should contain  + 
-  - the version(sit was merged to +  * php-src merge: https://github.com/php/php-src/commit/bae46f307c2d0cdef9b8f5426adcc46920776700 (will go into PHP 7
-  - a link to the git commit(s) +  * HHVM merge: https://github.com/facebook/hhvm/commit/b2df7016e63ddcf328dc5bcfdf18760bba8549ec 
-  - a link to the PHP manual entry for the feature+ 
 +No manual entry yet.
  
 ===== References ===== ===== References =====
rfc/unicode_escape.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1