Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73676 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82926 invoked from network); 12 Apr 2014 12:03:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2014 12:03:16 -0000 X-Host-Fingerprint: 89.177.142.61 ip-89-177-142-61.net.upcbroadband.cz Received: from [89.177.142.61] ([89.177.142.61:3829] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/C0-05511-D7B29435 for ; Sat, 12 Apr 2014 08:03:10 -0400 Message-ID: <3D.C0.05511.D7B29435@pb1.pair.com> To: internals@lists.php.net Date: Sat, 12 Apr 2014 14:02:55 +0200 Lines: 1 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3522.110 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3522.110 X-Posted-By: 89.177.142.61 Subject: Replacing ext/json and pecl/jsonc with pecl/jsond From: jan.tvrdik@centrum.cz (=?utf-8?Q?Jan_Tvrd=C3=ADk?=) Hi, Is there a plan replace ext/json and pecl/jsonc with pecl/jsond? Using two implementations is pain in the ass because they are NOT compatible with each other and it is unlikely to change in the future. AFAIK the latest version of **ext/json** has at least the following problems: 1) license incompatible with evil 2) causes fatal error for input {"\u0000": 1} 3) does not handle surrogates properly, e.g. "\uD811\uD811" is accepted and results in invalid UTF-8 Problems (2) a (3) are bugs (originally pointed out by Jakub Zelenka [1]) and can be most likely fixed, however problem (1) can not be solved. AFAIK the latest version of **pecl/jsonc** has at least the following problems: 1) does not care about UTF-8 validity at all (https://github.com/remicollet/pecl-json-c/issues/9) 2) does not support JSON_BIGINT_AS_STRING a) 64bit version causes a warning "option JSON_BIGINT_AS_STRING not implemented" b) 32bit version does not support numbers larger than 9223372036854775807 3) does not support \u0000 in keys (https://github.com/remicollet/pecl-json-c/issues/7) 4) does not support extended numbers syntax which is implemented in ext/json [2] Unfortunately most of those problems are known for a while and there does not seem to be the attitude to fix them. AFAIK the latest version of **pecl/jsond** has at least the following problems: 1) does not support extended numbers syntax which is implemented in ext/json [2] However since we dropped in PHP 5.6 the extended literals syntax (e.g. TRUE) we may consider dropping the extended numbers syntax (e.g 0xff) as well to make it strictly follow the latest JSON RFC (http://tools.ietf.org/html/rfc7159, March 2014). I think that the best long-term solution is to replace ext/json with pecl/jsond, preferably in PHP 5.6.0. [1]: http://news.php.net/php.internals/73478 [2]: https://gist.github.com/JanTvrdik/10277952#file-test-php-L43-L60 Thanks, Jan Tvrdik