Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73677 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86633 invoked from network); 12 Apr 2014 13:33:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2014 13:33:33 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.42 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.42 mail-oa0-f42.google.com Received: from [209.85.219.42] ([209.85.219.42:54990] helo=mail-oa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/31-05511-3A049435 for ; Sat, 12 Apr 2014 09:33:23 -0400 Received: by mail-oa0-f42.google.com with SMTP id i4so7482747oah.1 for ; Sat, 12 Apr 2014 06:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rw24Kk9m7QH3j3koAf1aB9exZ7WJjoghNbsLhCG2TbE=; b=jtHCBxwQ+ZmAb7xzuBY+TJod3Qe9tTe0DXYJF11cil65ri+kSX38MEnddv7nFYjGkg lv6xTV55OFAdPB4VWT4UlO9/cVfseLn2TXaYOQm4sMQWoP+joBMa9qToapRozsi0qBbz CN/muD2leArtAhUBI0yk1PXrpT2oz8Mt/VQX8Ywtyyu2m0LaC888k3t3bdAe7CO0dycJ VfpfayDtlf5eCQRUomnLC5TuoFusMfdlKQkLPM66wlwwTl/ZcUiqYyj5KkgDsZFFHYCT A1ZUK1O8yXk4FKelhNhmg3NUGdp2kHWogHZ+FtXhwLsZdvgVTEoV1AVG5Bh/ONJGkzC1 WKQw== MIME-Version: 1.0 X-Received: by 10.182.153.226 with SMTP id vj2mr24963298obb.26.1397309601084; Sat, 12 Apr 2014 06:33:21 -0700 (PDT) Received: by 10.76.77.100 with HTTP; Sat, 12 Apr 2014 06:33:20 -0700 (PDT) In-Reply-To: <3D.C0.05511.D7B29435@pb1.pair.com> References: <3D.C0.05511.D7B29435@pb1.pair.com> Date: Sat, 12 Apr 2014 07:33:20 -0600 Message-ID: To: =?ISO-8859-1?Q?Jan_Tvrd=EDk?= Cc: internals Content-Type: multipart/alternative; boundary=089e013d0dc069fc7004f6d87e69 Subject: Re: [PHP-DEV] Replacing ext/json and pecl/jsonc with pecl/jsond From: morrison.levi@gmail.com (Levi Morrison) --089e013d0dc069fc7004f6d87e69 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, Apr 12, 2014 at 6:02 AM, Jan Tvrd=EDk wrote= : > Hi, > > Is there a plan replace ext/json and pecl/jsonc with pecl/jsond? Using tw= o > 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 92233720368547758= 07 > 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've never encountered any of these issues so I have nothing more to say on them.* > I think that the best long-term solution is to replace ext/json with > pecl/jsond, preferably in PHP 5.6.0. > PHP 5.6 is in feature freeze. You'll have to shoot for PHP 5.7 or 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 > * As an aside I support the no evil clause. I realize I am in the vast minority here, but I wanted to say it. --089e013d0dc069fc7004f6d87e69--