Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118317 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92908 invoked from network); 30 Jul 2022 04:30:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jul 2022 04:30:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C33151804B5 for ; Fri, 29 Jul 2022 23:29:55 -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,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS63949 74.207.252.0/24 X-Spam-Virus: No X-Envelope-From: Received: from malamute.woofle.net (woofle.net [74.207.252.100]) (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 ; Fri, 29 Jul 2022 23:29:55 -0700 (PDT) Received: by malamute.woofle.net (Postfix) with ESMTPSA id 123401EF73; Fri, 29 Jul 2022 23:29:54 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: <0d5ad8ab-aa7a-c37c-2d26-17e6b6953b4e@alec.pl> Date: Fri, 29 Jul 2022 23:29:53 -0700 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <5426361E-43A2-4B3D-9042-57FAD6F1FF0D@woofle.net> References: <0d5ad8ab-aa7a-c37c-2d26-17e6b6953b4e@alec.pl> To: Aleksander Machniak X-Mailer: Apple Mail (2.3696.120.41.1.1) Subject: Re: [PHP-DEV] RFC Idea - is_json - looking for feedback From: dusk@woofle.net (Dusk) On Jul 29, 2022, at 23:05, Aleksander Machniak wrote: > json_decode() has $depth argument, I think is_json() probably also = should. And I'm not sure about JSON_INVALID_UTF8_IGNORE flag. >=20 > My point is that if you use these with json_decode() you might also = need to use these with is_json() How about if validation were a flag to json_decode() -- perhaps = JSON_VALIDATE_ONLY -- which made it return a placeholder value like true = instead of the decoded structure? (It can't return null on success; = that's used for errors if JSON_THROW_ON_ERROR isn't set.)=