Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118325 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 57918 invoked from network); 30 Jul 2022 20:57:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jul 2022 20:57:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2E5E618037E for ; Sat, 30 Jul 2022 15:56:09 -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_20,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-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 ; Sat, 30 Jul 2022 15:56:05 -0700 (PDT) Received: by mail-oi1-f179.google.com with SMTP id r13so9401219oie.1 for ; Sat, 30 Jul 2022 15:56:05 -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=fqUTR1jr1NZvaazaVkq1Se88WAgxdpa3gf46qc4+Ziw=; b=gRDl2Z3ndSJml7trKNiDLMDPNqYVhqqFG/PYqTS9aQeOoPjUPJUo2NhHRjmQ/Q2NZ/ Cb7VmxTVxTlNXnN6MUhU+x9l47HLzE3gMMiDl2ILg4T2y5yNueVzJF85UNY42+3c7i4K MTnDWXoXXyKlYnkeyz8wJmS2A4YagSPqksPxhCba2Ya1Ax4TI0T0iyZ4PlUWXO8vTnCe eJ/Jh8Yr9CSgM87WWq75wCHeTskhvTpJ9TdTnvU7GRoSB9mSfmNruzBmaKYznfk9A+AI 2IFD8mJ1HpLMbMWn/GgvUl5zYrUGkaWVPkmtWZXy6OHa3spk7++jGTVnX643pWmyuPdD 8SPg== 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=fqUTR1jr1NZvaazaVkq1Se88WAgxdpa3gf46qc4+Ziw=; b=bMTUA6UVZlrxbYr6Gyiyn61IkujAxVONo8/EGTKUl69IU5c3rwoZbPTl0bRIbGDc8q kKdwJZl0Jov94VYG+ZuJdwjXGFHw3GdNR2C3gBj76NDv7V+epkhY3XM9xkaQhV6CbwE1 v+b2gomrMc6kHlcUzhgLsb2S+vHlnk6DWv3B2Bdcb1JwDzkhuEY7WBSrZfgJi9pXRLUh XqLdvSspu7Y8i6/3a3uhJUrj4DndEap9kn8W3nw82Dzt4h7tzCQrYct3CRbuBGwT2L5S 0psAF2w1o1a+9xR11zerhs4unKU/zOHz91r3dPkCSBQqGerIx0de92TdftQ+7fxny+Kt njMg== X-Gm-Message-State: AJIora+lwe87JHSOj2UGw7ZMt3O1ui/0qyOtHci6yg16Qh+daiEQVXsC Jeb27Su+Siu0w0Cpp9Wa4i847wTJDdayIPW8Cvc= X-Google-Smtp-Source: AGRyM1sq5JE8Ox5CRnfSE2CRKQ2RwnW2/+lfT2zFfQWJJsbPzeOiDZAYQRhqwuJl5TeDJt4wYrOn8BB3IoDTkj7fo98= X-Received: by 2002:a54:4082:0:b0:33a:d606:91e with SMTP id i2-20020a544082000000b0033ad606091emr3957828oii.248.1659221765047; Sat, 30 Jul 2022 15:56:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 31 Jul 2022 00:55:54 +0200 Message-ID: To: David Gebler Cc: Nikita Popov , juan carlos morales , PHP internals Content-Type: multipart/alternative; boundary="000000000000e8cb5405e50dab98" Subject: Re: [PHP-DEV] RFC Idea - is_json - looking for feedback From: deleugyn@gmail.com (Deleu) --000000000000e8cb5405e50dab98 Content-Type: text/plain; charset="UTF-8" On Sat, Jul 30, 2022, 4:48 PM David Gebler wrote: > > > What I'm asking is what's the practical use for this proposed function? > Where are you likely to need to know if a string is valid JSON but not have > to (try to, with error handling) parse it almost immediately afterwards > anyway? > I'm still on the fence over the general idea, but I thought I could at least address this question in particular. I can definitely see it's usefulness on public HTTP API ingesting data (specially large data) where if the payload is a valid JSON, it gets stored and processed by a background queue, making it so that the HTTP layer can either reject the request with a 4xx status or accept it and only truly decode it on a separate process that may even be hosted by a separate server with larger memory size. > --000000000000e8cb5405e50dab98--