Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118194 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2506 invoked from network); 5 Jul 2022 05:52:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jul 2022 05:52:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C4953180546 for ; Tue, 5 Jul 2022 00:45:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15576 212.103.64.0/19 X-Spam-Virus: No X-Envelope-From: Received: from mx.kolabnow.com (mx.kolabnow.com [212.103.80.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 5 Jul 2022 00:45:03 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id E363441F16 for ; Tue, 5 Jul 2022 09:45:01 +0200 (CEST) Authentication-Results: ext-mx-out003.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:references:content-language:subject:subject :mime-version:date:date:message-id:received:received:received; s=dkim20160331; t=1657007101; x=1658821502; bh=bnAwizmvKMZW8H8x xcG2DK2F4E46dzIhSlNW2ZhozLs=; b=PcXUKX9l0j+oHyyuAUENnLR24aFV6uAn J0zD4vaPg8KQA3Orzd4uh5guIeEhaPfVYkOUMudXSU8KVpiEyHhhQpGpmpPp4R5P Ti+qgPqS6Pe6nZCNVk7wfsFqfSMssDOagrLFH1m6mOWJi4XkFigMhHfne7MDtojw 7MXbrSPdJ19OxVY3PlgNuN5g3MZZu+0XRg3Zugg2zEx0nRtwIX9nw+xKHlQJW8os dh78yHO+CfaslBpp6BUib8T0ROeKyZ+ueB0xx4VCWbuxdHKML30wVs8VfY3QISvY 8Uk2ZH+gS1niLxwM71GmuQ/YiPg4nUf6UILbnLk6IQNWawXkE7Qml/xTwmJHPsu8 7b6IGDYyJRbJ97cwOdp2K0k514YtC//r/3pvTR8DGdcFQp5p3ukIS33uKFqcRSN4 FlW1ZwaQKJfxVZ/OndfsdHfhpOG2lpqgCkYESmOvRLpxHsZXVai8xauL6+QsCG8U tmyh4vtjIjGJJ4XU2g0b8oHqAprPybWGK1E5XQT61DTCqocEESy1+Zp+BnoPOC5n /YRfPvfRaGPgxkAB6M6xQxs7N+bnKUFMa94sJjJUOHZdzUflcCh8/DCtWGcBmnzf uGA+ehanVRpt6hFQvh9P8dKWcKj/p+lC7lLxYNyYny0VM5y/3yPBgIrgH9nnWWlJ FBclZnHHp90= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XEXt4FS4DeoU for ; Tue, 5 Jul 2022 09:45:01 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by mx.kolabnow.com (Postfix) with ESMTPS id D5DB841A1F for ; Tue, 5 Jul 2022 09:45:00 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 6AFEC373C for ; Tue, 5 Jul 2022 09:45:00 +0200 (CEST) Message-ID: <897a7af9-685f-4e87-3331-d99e36521f2e@alec.pl> Date: Tue, 5 Jul 2022 09:44:59 +0200 MIME-Version: 1.0 Content-Language: en-US To: internals@lists.php.net References: <7d72b5c1-d19b-8734-57e0-f02c402b09c2@gmail.com> <64e73280-83aa-c60d-4c01-54a617c5468f@gmail.com> <8fd7bed5-2392-dec2-27d4-f2055e7021f1@heigl.org> In-Reply-To: <8fd7bed5-2392-dec2-27d4-f2055e7021f1@heigl.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Add json_encode indent parameter From: alec@alec.pl (Aleksander Machniak) 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