Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118366 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92204 invoked from network); 7 Aug 2022 15:10:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Aug 2022 15:10:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3B9FB1804B5 for ; Sun, 7 Aug 2022 10:11:14 -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.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) (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 ; Sun, 7 Aug 2022 10:11:13 -0700 (PDT) Received: by mail-vs1-f51.google.com with SMTP id v128so6895553vsb.10 for ; Sun, 07 Aug 2022 10:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dgfx2+s/Tdcd/sbozDHvB6ly4Ve51fezvPXpt6vG+/I=; b=qH9kvSVLxr9xVrnLEBcm14BJefuVy7YSQTWr57l3vIAt/cPlqsrBHMqeruqg6sYdya sB6u+KO0nY0ccDosaH7sn0i4Vg7mZDYNbC3Ghs99NUbkLRUKGRP2gE0hFh08w2Qkrr+i rBUe6dBvF30MFt8FmaUOQMdTH0lY5gt8N7OzXjLbVt4bhE0uXNibgAeBQEQ+kU0s+tKK FpVd9FXA1fyTOtPd11BPbcgFkvqpDZio9xysG4HyPcBlGAlnK806UNehSWoqH2lOBouC tk0NX3g8AdtcZeNPVbToQ+PCqNJko0DYZB++9ACmBrqVnOiXGjjSTd0s2qwhn9V45EcX Ax7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dgfx2+s/Tdcd/sbozDHvB6ly4Ve51fezvPXpt6vG+/I=; b=6RaULl5V5jhGzTs7XupxbTLGpYJUli17WIH5HWyKX91YW36kD0a3jliIKUKG1CMvcS 5fajGfL2bH/o5B9bYMkR0xXiq7fs1m7yu0ekP674OXg8GHFFTIJVmCyaR4pEyQnyzm+q Vdxnbn7K3pXMeYJEThQBO1CdzOpTlXlB5cv2DeWTZ3NipNo2E67sQ+2kk3PGAGv5rhMF UziO91kFJlYOy7aEl5XC3uRkKnHSDbuUi7FtkLopYQ+DLIG13ksiL3V5J68H2D/kqCiS Tyny4Y1pqjxJkPKX15/mdfKoTUIbj7uxGtamuiniJntAp0B158ORySSZiRjLlmQ61ciU 7obQ== X-Gm-Message-State: ACgBeo1hEm+pJrb4qHXW2eHfAky2MR4VzLouoMr7NKor62/EV/YlV2Hm 4viLXD73c+sYvUx+8U7Cc6AReFONWagp4klMcSS5hX/I5uA= X-Google-Smtp-Source: AA6agR6J7Q3JehWjSsqAU/xnfd4VJ9eAIv0fieOWyARJC0XgF/6Gr9nJbmcBDfOXa0B9Ld9z7e/gX8xL6h+vp2UbfZ4= X-Received: by 2002:a05:6102:3d03:b0:388:4e6f:62c6 with SMTP id i3-20020a0561023d0300b003884e6f62c6mr6304600vsv.13.1659892272735; Sun, 07 Aug 2022 10:11:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 7 Aug 2022 19:11:01 +0200 Message-ID: To: Ollie Read Cc: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= Content-Type: multipart/alternative; boundary="000000000000482b9b05e5a9c97a" Subject: Re: [PHP-DEV] Re: RFC Idea - is_json - looking for feedback From: dev.juan.morales@gmail.com (juan carlos morales) --000000000000482b9b05e5a9c97a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Ollie. Dont be sorry. Actually I appreciate every feedback I got. I promise I Will not dissapoint anyone. I Will prepare de RFC next week. Regards. Juan El dom., 7 de agosto de 2022 14:03, Ollie Read escribi=C3= =B3: > Hey, > > While I'm not opposed to the idea, I'm struggling to think of a way to > accurately determine whether a string is true JSON that doesn't involve > some sort of parsing. > > Sure some regexes can be run on it, but I'm not sure that will ever be > 100% accurate. Any parsing of the JSON to determine whether or not it's > valid JSON would, in most situations, lead down a code path that then > parsed the JSON again, essentially repeating the same function for little > benefit. > > I personally like to use the *`JSON_THROW_ON_ERROR`* flag on json_decode. > > Not trying to rain on your parade, so sorry if it comes across that way, > I'm just not sure of a way to do it where the benefit outweighs the cons, > but then again, there are people a lot smarter than me on this list. > > --- > Best Regards, > *Ollie Read* > --000000000000482b9b05e5a9c97a--