Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118167 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4294 invoked from network); 4 Jul 2022 05:45:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jul 2022 05:45:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5D7FB180212 for ; Mon, 4 Jul 2022 00:38:20 -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=0.0 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 4 Jul 2022 00:38:16 -0700 (PDT) Received: by mail-ed1-f46.google.com with SMTP id r18so10554294edb.9 for ; Mon, 04 Jul 2022 00:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=yxZsjPuctHWy5IO5baSbMfEQZ75MnVkz1WeOXBtcZOw=; b=KW/6gTKtBxnQFaYz2JWIqCNaCC9fzmtL6ta/IG+jYsxKGY0pvk6nUIzeO8G0t2BK6+ 1Ik1ZaujdWASWuI3eMcVlDGTdyP62bL4ytKllilmr0G86WQnWIscUC+znuHHVYlVKhTi iH9V2W3NpWTaArPMlvNHfDZiXqT46QHeeL8wVnym+0PKrEJAgRZkXs0aC8rvla2izkRY JXOfIeXIuSq8merX+6oyWZZjtjdNEHLiTrAX10a1RFPMmL58ss98UuVuOWY4A7N+E8e9 CqCeAyIkFIK/flVPwazgSFA24WmhNG8iy4P+QfcoEdX2bbdV/b7Aa4lpDcFjBj0E2WCo pucA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=yxZsjPuctHWy5IO5baSbMfEQZ75MnVkz1WeOXBtcZOw=; b=C67hr3Drf4l0ZwKrdp2Dsi/F7dFGfmqvc6lB+kGV/QFUpUwRmpnp/uFOB/4JHZKx35 ep1FOdSFfh79AW65Nva7Gp2dV7tkRFoqmD+9fLRZz+b2LX6Sla154dCntW1T21e00VeQ Bd/NsEqvBH6POZbhjsxhFDAHyinSo1/n5XR+MBOqHLjkIykRSTjffBjB97VV0bxB/dCo wxzacP0y9B6KwhHyQ5ksW4m2YpCOoI+fCD/tnz3WvrVRylFLU1I0c+W0Wh50BtoSiskW cHZIVTBrZyxqT3ySt3r1ICxhJGTqWGLj2YoQEhFQd3rs4FfAlUz9P3Vjnz8gy7wlUplc MEZA== X-Gm-Message-State: AJIora+CePACfpoXJXU7Zz0NQ9GtrblePWonO/dZtx9fMmIBHlscr+qH n9Gin5gPW3J04oD8l5YXJWKBSn5ZRX4= X-Google-Smtp-Source: AGRyM1uSKuo3N3666uuxKuEmhXGkP2yDdLFWgwrydSvxgGNHPh7cQf9aveqeo/TR+gX+JZC8GyCbiQ== X-Received: by 2002:a05:6402:5193:b0:435:9a5f:50a8 with SMTP id q19-20020a056402519300b004359a5f50a8mr36705457edd.212.1656920295671; Mon, 04 Jul 2022 00:38:15 -0700 (PDT) Received: from ?IPV6:2a01:7c8:7c8:f866:10::1001? ([2a01:7c8:7c8:f866:10::1001]) by smtp.gmail.com with ESMTPSA id d2-20020aa7d682000000b0042dddaa8af3sm20096569edr.37.2022.07.04.00.38.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jul 2022 00:38:15 -0700 (PDT) Message-ID: <64e73280-83aa-c60d-4c01-54a617c5468f@gmail.com> Date: Mon, 4 Jul 2022 09:38:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: PHP internals References: <7d72b5c1-d19b-8734-57e0-f02c402b09c2@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Add json_encode indent parameter From: tdegroot96@gmail.com (Timon de Groot) Hi internals, If the rest also thinks the RFC is good to go, I suggest we start a vote coming week. As this is my first RFC, I'm not so sure how this typically gets kicked off, so I'd like to know what I need to do! Kind regards, Timon On 04-07-2022 00:01, Jakub Zelenka wrote: > Hi, > > On Fri, May 13, 2022 at 2:33 PM Timon de Groot > wrote: > > Hi internals, > > Almost a year ago I first proposed my RFC draft to introduce a new > json_encode parameter 'indent'. I have received a lot of feedback on > the > change, very insightful. The feedback can be boiled down to: > - Accepting user input characters means you could create invalid JSON. >    Do we want that? Should it be complying with the spec[1]? > - Preference for pure types, so int OR string, not both. > > So I think I made the change more complex than it should have been and > considered the three options: >    1) Accept indent as an int, which will result in N spaces of indent > per indentation level. >    2) Accept indent as a string, which will result in string N per > indentation level. >    3) Accept indent as an int and indent_char as string, which will > result in N * indent_char per indentation level. > > Option 1 seems very simple and feasible while not being confusing. > Option 2 seems feasible, but somewhat more complex, because user input > should be validated. > Option 3 seems very flexible, but in my opinion very confusing at the > same time, while I'm not sure there's even a use case for this level of > flexibility. > > I have updated the pull request[2] and RFC[3] to be based on option 1, > as I think this offers clear functionality and I feel like I can't > really go wrong with the indent parameter as an int. > > Please let me know what your thoughts are and what needs to be done to > get this RFC going forward! > > >  I think we can put this RFC to the vote. If the author is to busy I > would like to start voting later this week. It would be a pity not to > make it to feature freeze as it is quite straight forward and the > implementation seems good as well so I guess we don't need to wait extra > year. :) > > Cheers > > Jakub