On 05.07.2022 09:37, Andreas Heigl wrote:
What I would have prefered is instead of a the new parameter $indent
having a numerical value to have a string value.
That would have allowed the following:
json_encode($data, indent: " ");
or
json_encode($data, indent: "\t");
That would have made the tabs vs. spaces very easy and people can also
add whatever they want to set for one indentation. Think about setting
dots for making the spaces visible for some formatted output or whatever
else people might think of.
And setting the "indent" parameter would always implicitly set the flag
"JSON_PRETTY_PRINT" (as it doesn't make sense to not have that set).
The current way of just being able to set a number of spaces to indent
or to use a flag for tabs is a bit fiddly at best and does make adding
accessibility a second class citizen. Therefore I will vote against this
current implementation.
I voted No for the same reason.
--
Aleksander Machniak
Kolab Groupware Developer [https://kolab.org]
Roundcube Webmail Developer [https://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php