Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64508 invoked from network); 10 Apr 2015 22:00:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Apr 2015 22:00:10 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.49 mail-vn0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:33631] helo=mail-vn0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/A2-41461-7E748255 for ; Fri, 10 Apr 2015 18:00:08 -0400 Received: by vnbf1 with SMTP id f1so8931171vnb.0 for ; Fri, 10 Apr 2015 15:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Aelm+L/wm5Q4rGAf/attomgNo5a7JWkKRh/MCgvEKBs=; b=kjK1FqCDt8TzzHqF2d4Irr5sVCqFlZXQbrX/3Ee0/qP+RQcntc3iDI2dLFDERf7Dea FtiBD+wiNDeHtAyduJptwR4swW47AMyTkmf8Nf64WDx1xFV5iPvpe22cMAF1OrjtnKnJ 3jRv9Cr3mooog1JaNeLyGrrwnpHGxqarDJvUdO2mxcbJttAveSXLLAJC/Ic4rmse+xTu a9J9bIPYDre0ieKOZ6NwLvVEqeg+Iw8kvhmS6B7nyGVrq2hip1oGNE2XV4jBu0ofqPOj LfSHBIDAcHuDawjM+j+U9z+028tXZDKrotbBfqjxm/rG5QHIvwh/Pu+r+xTSuYg1yVCT 3vQw== X-Received: by 10.60.77.38 with SMTP id p6mr4436442oew.75.1428703202770; Fri, 10 Apr 2015 15:00:02 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.104.196 with HTTP; Fri, 10 Apr 2015 14:59:21 -0700 (PDT) In-Reply-To: References: Date: Sat, 11 Apr 2015 06:59:21 +0900 X-Google-Sender-Auth: cMUSEg-ZbuKoHCkRoFjRZQ_jHPM Message-ID: To: Jakub Zelenka Cc: PHP internals list Content-Type: multipart/alternative; boundary=047d7b33d3a4e40494051365e209 Subject: Re: [PHP-DEV] JSON float number as string From: yohgaki@ohgaki.net (Yasuo Ohgaki) --047d7b33d3a4e40494051365e209 Content-Type: text/plain; charset=UTF-8 Hi Jakub, On Sat, Apr 11, 2015 at 1:37 AM, Jakub Zelenka wrote: > On Fri, Apr 10, 2015 at 1:29 AM, Yasuo Ohgaki wrote: >> >> Could you add "json_encode" type hint also? >> > >> Large int/float must be treated as string or GMP object (we don't have >> GMP float yet, though) >> > Currently, there is no way to encode large "numeric" JSON data correctly >> when it is stored as >> string. >> >> string json_encode ( mixed $value [, int $options = 0 [, int $depth = 512 >> [, array $type_spec = NULL]]] ) >> >> where $type_spec specifies correct data representation. i.e. numeric, >> string, bool >> >> json_encode() type hint should work like Zeev's type hint. >> i.e. No data type conversion, but validate its content. >> >> > Again this is a bit off-topic. I think that it would be good if you could > create a bug report for this. It would be great to add an example how the > $type_spec should work (e.g. if you mean something like > http://json-schema.org/examples.html ) > Yes. We need something like this to make jason_encode() work as it should. FR is added. https://bugs.php.net/bug.php?id=69422 Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --047d7b33d3a4e40494051365e209--