Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86371 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87419 invoked from network); 25 May 2015 06:59:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2015 06:59:29 -0000 Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.182 as permitted sender) X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.217.182 mail-lb0-f182.google.com Received: from [209.85.217.182] ([209.85.217.182:35465] helo=mail-lb0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/F0-50927-F48C2655 for ; Mon, 25 May 2015 02:59:28 -0400 Received: by lbbuc2 with SMTP id uc2so46219981lbb.2 for ; Sun, 24 May 2015 23:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/Vi0H3AWktU3ObNi3yBRyNxdNXO8/hfo+Qimvcts4E0=; b=sKUBwxZebencvlEHKMXjmGQZBj/q0i1faD5EysR2QJgGSnP3pGP5tH2AbbHgg3HS5m yGkRN2fbBxnU2tRAAYrasQQdXhpgCxeJb/4K4o9hGJRURqQKfDRwRbZXumxt2t5bWJKx LgTrW/xZHN65qYFD2cfS/JcODoUEC+ucg8QYwCsb44Y+O/Z8sXK/UgyTVMMm0t9hn9Ly +jrWWBSDKbvf/cffATr3ae24TiWot6iFKBb38KlQvPDTnj11HGBvVAqXaqxJ1qgRmIJq eTJxnpmN18Ucw9YoaUAECbz45Bejk/UAYPoVf6hUxyUlQ/fh3MjdxE8b7x4ViHzlYCZW tE8w== X-Received: by 10.112.40.9 with SMTP id t9mr17417108lbk.55.1432537164054; Sun, 24 May 2015 23:59:24 -0700 (PDT) Received: from [10.0.1.28] ([91.219.26.208]) by mx.google.com with ESMTPSA id c2sm2192206laa.43.2015.05.24.23.59.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 May 2015 23:59:23 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (12F70) In-Reply-To: Date: Mon, 25 May 2015 09:59:22 +0300 Cc: PHP internals list Content-Transfer-Encoding: quoted-printable Message-ID: <5E3BAD6C-BC6B-4BBC-92E5-37AD7A6891E0@gmail.com> References: To: Jakub Zelenka Subject: Re: [PHP-DEV] [RFC] JSON number to string From: indeyets@gmail.com (Alexey Zakhlestin) > 24 =D0=BC=D0=B0=D1=8F 2015 =D0=B3., =D0=B2 19:02, Jakub Zelenka =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >=20 > Hi, >=20 > I would like to introduce my and Pasindu's RFC that proposes adding of new= > JSON options for converting number values to string when decoding and/or > encoding: >=20 > https://wiki.php.net/rfc/json_numeric_as_string >=20 > Personally I'm not a big fun of these options because of their drawbacks > (see RFC section about that) and because I think that Json Scheme is a > better way to go. However I'm not sure when and if I have time for Json > Schema implementation, so this could be useful for some users the meantime= . > That is especially case of JSON_FLOAT_TO_STRING for decoding (encoding is a= > bit weird at it requires usage ini precision to do something useful). That= > (decoding) seems like a sort of a variant of JSON_BIGINT_TO_STRING for > floats. That will be probably the only option that I will be vote for. I'm not sure how JSON Schema would help here. The issue is about converting f= rom json's huge numbers to limited PHP's numbers. Schema just doesn't have n= otion of native types Anyway, as I told in a previous thread, while approach of this rfc solves im= mediate problem, it is not future-proof flexible and exposing low-level type= based parsing is a better idea=20=