|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2012-11-23 13:27 UTC] remi@php.net
 Description: ------------ The json extension provides a duplicate implementation of php_next_utf8_char. This is also related to Bug #63520 The attached patch use php_next_utf8_char function and allow to drop "utf8_to_utf16.*" non really free files from PHP sources. All the json unit tests succeed with the patch applied. It seems, there is also a small performance gain (~5% on very large json_encode) Patchesphp-5.4.9-json.patch (last revision 2012-11-23 14:14 UTC by remi@php.net)json.patch (last revision 2012-11-23 13:27 UTC by remi) Pull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
@yoram: the previous implementation have the same problem. for (;;) { ... if (w) { ... For now, there is no performance degradation, but a small improvement (according to my quick bench, ~5%) Of course we can optimize this (and probably also the "bits" handling in json_escape_string, avoid the REVERSE code and make it more readable) smart_str_appendl(buf, "\\u", 2); smart_str_appendc(buf, digits[(us & 0xf000) >> 12]); smart_str_appendc(buf, digits[(us & 0xf00) >> 8]); smart_str_appendc(buf, digits[(us & 0xf0) >> 4]); smart_str_appendc(buf, digits[(us & 0xf)]);