Re: json_encode indent parameter

From: Date: Thu, 03 Jun 2021 15:53:09 +0000
Subject: Re: json_encode indent parameter
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-114715@lists.php.net to get a copy of this message
Hi Timon, Thank you for this RFC. I think the string|int $indent approach is great 🚀! Reading the PR, it looks like $indent=0 is essentially turning off pretty-print, which I think is intuitive. Do you plan to add any sort of validation on negative integers? Perhaps throw a \ValueError exception on $indent < 0? --- Thank you. Ayesh. On Thu, Jun 3, 2021 at 9:19 PM Timon de Groot <tdegroot96@gmail.com> wrote: > > On 3-6-2021 16:15, G. P. B. wrote: > > That's incorrect, as of PHP 8.0 Fast ZPP has a way to deal with the most > > common union types, including int|string. > > > > Best regards, > > > > George P. Banyard > > I found that STR_OR_LONG works fine, thanks for acknowledging! > > -- > > Kind regards, > > Timon de Groot > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >

« previous php.internals (#114715) next »