> On 10 Dec 2014, at 18:55, Sara Golemon <poll...@php.net> wrote: > > On Mon, Dec 8, 2014 at 3:51 PM, Andrea Faulds <a...@ajf.me> wrote: >> Please read through the RFC and cast your vote if you wish to do so: >> >> https://wiki.php.net/rfc/unicode_escape >> >> Voting starts today (2014-12-08) and ends in 10 days’ time (2014-12-18). >> > I was just updating my HHVM patch to match your PHP implementation and > an issue came up. The following code, which is valid in PHP5: > > <?php > echo json_decode("\"ma\u00F1ana\""); > > Will throw a fatal compiler error as "\u00F1" is an invalid unicode > escape sequence. Since this represents an unnecessary BC break, I'd > like to propose the error handling be modified to match \x, which is > to say: Pass the value through unmodified.
I was wondering about that case. Previously, the patch just raised a warning but let it through unmodified. But then old code would be littered with warnings, and I felt it was better just to throw an error. Part of the problem is that I’d rather mistakes in string literals be caught at compile time, to prevent someone accidentally echoing ‘\u00F1’ somewhere. A possible compromise might be to let ‘\u’ through but not ‘\u{‘. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php