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/14 02:53] – Update HHVM implementation pollita
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 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 (includes name support): https://reviews.facebook.net/D30153
  
 ===== Implementation ===== ===== Implementation =====
rfc/unicode_escape.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1