Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118477 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84984 invoked from network); 25 Aug 2022 21:15:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Aug 2022 21:15:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3EFD6180543 for ; Thu, 25 Aug 2022 14:15:44 -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.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.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 ; Thu, 25 Aug 2022 14:15:43 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id k17so10813958wmr.2 for ; Thu, 25 Aug 2022 14:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=rg+PT3RUrIf70WyYIrdyKJ/fXAMjZ7wq9GTWdwFXf34=; b=liMSTB4v4KbsknV2LdDntqzjNqOrGxx3jKBlItQjGYJN+vbj7a2Qmk9Mv4OUOynPRK 6SIhw6bbE2yuXv1HaJ0+nBX3OBSu7GymWlEaO39aAQvACNDiiv3J4tWAIzCvmcPu7mWE gsvabfA576MkE39mqHgMVtf0mA9DquQtkLa/FIECEYKs0FMTCDYZjTAWodXIWqNWH+BM ynjn7xG3aDkkdkUzHCCrKMu33EIF8648B6x8M/nfqOQ7jMnr7kE0WVb0lLauesR0IPND pri83kYcAhpL168ZCC1y8YU4BU7A60dhdB21gRKKWQnzoMoRbdX+rf0MsqmUHqRFLvH1 tyyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=rg+PT3RUrIf70WyYIrdyKJ/fXAMjZ7wq9GTWdwFXf34=; b=XfhsPMdrRj7ZQfJYCVb0yV5HPiwOaBArIq78c9+U7AgkbuuMeUJVoU4FLDhr09ecKL v65zVwiOv9mjUmZGuvB7O73JK9ws1r2BE6rzHv0HSded6AnGjyoRcxG8Ch9jD6TLbsew KMBH8fvdt6YhyCWyWMPKDAm7XOBGQwFfD3PtbCXRoQbzENZd/1N7jyYwOdWs7WLNLkoP 4qNgRKkSG8n44VUN/vTc0O0lQPId15HBSueA3u7jkck7V1P0HDCLZ8cDiHHwpaIUzZaq eQSpIREaMy44xYeAXER2TD1tU+xxw2I/IiFasKbSuJNnMWdQ9OTyAn6T1Q8hdTlWBdos PmVQ== X-Gm-Message-State: ACgBeo3l3maeMiJEEAJyw6skSXhwINUzAYAeajUMvlB17ytnOB96kiqX D6ljmnYo2fvH1RJL81bd1yDXhadezB4= X-Google-Smtp-Source: AA6agR74WFaB0lqV/s2xwsYV9z2o1sTD3MatnwVoGGnoRVT8mSJr/K6iB+x1JdWQ/YyEAEC4yamr4g== X-Received: by 2002:a05:600c:2114:b0:3a5:4f31:3063 with SMTP id u20-20020a05600c211400b003a54f313063mr9686602wml.50.1661462142573; Thu, 25 Aug 2022 14:15:42 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id e16-20020a05600c219000b003a5537bb2besm335271wme.25.2022.08.25.14.15.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 14:15:41 -0700 (PDT) Message-ID: <816aeb23-523a-f81a-7eba-d12a4d7292d3@gmail.com> Date: Thu, 25 Aug 2022 22:15:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-GB To: PHP Internals References: <30876360-1d4f-8097-0b58-fd902f1fa009@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC json_validate() - status: Under Discussion From: rowan.collins@gmail.com (Rowan Tommins) [Replying to list - make sure to hit "Reply List" or "Reply All", not "Reply" in your mail client] On 25/08/2022 21:59, juan carlos morales wrote: > Hello Rowan thanks for participating. > > My answer for your comments would be: > > === Regarding JSON_THROW_ON_ERROR === > I think is a valid point from your side, and I am open to change the > implementation if the maintainers believe so. I leave it there as it > existed in json_decode() and wanted to give the developer the option > to use it or not. But as I said, you hae a valid point, that I also like. Just to clarify, "the maintainers" of PHP are basically everyone on this list, trying to reach a consensus; there isn't really any core group that makes the final decision. There is a binding vote at the end of the RFC process, but it's in principle just a way to measure that consensus. > > === Regarding the examples you mentioned === > The one from humhub and Symfony http-kernel, yes you are right, I will > take them out from the RFC right now. Nice catch. > > But the Magento one, I took a look again, and I still believe is right > example, because the only reason is using json_decode() for, is to > validate only. Am I missing something here? It's not entirely clear *what* that Magento code is doing, but it's definitely not just validation: the output of json_decode is passed to $this->_jsonEncoder->encode(); if it was just validating, it would return $input, or true. My guess is that like the Symfony example it is "pretty-printing" existing JSON strings. Regards, -- Rowan Tommins [IMSoP]