Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114711 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70517 invoked from network); 3 Jun 2021 14:01:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jun 2021 14:01:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 312571804DB for ; Thu, 3 Jun 2021 07:15:29 -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=-2.1 required=5.0 tests=BAYES_00,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 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 3 Jun 2021 07:15:28 -0700 (PDT) Received: by mail-ed1-f41.google.com with SMTP id dj8so7320286edb.6 for ; Thu, 03 Jun 2021 07:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WYSObYj72OC8hVKwlWxoWFX95GbTM3VKXeoR98UYA4Y=; b=uiqCPVZj2NIcU8meRmeOo/A7JIQTyHiRHzHeXnPtgeC19ByKLvYxpqYHYw4vk0tX5Q rwLSSL9iZmO0X1Rej8frfKG8TT5rMqgFC0/s5cNETY/QqxeFcnK6aJ6d3Rj3vXa40igY qfEZpOz++F7f8yxMZscN0kHHQow/L5dSRR29FvOh09NTTlnRlK/2l8VHsLNBvDewH1me KDFU+R5B4xU87LXYcKkER4BKQC5G9KhEiLnG6y9wLSTnIeJ5vJ4EIGzfKaYrRCqj5Q13 qK2YMAR73N7O7luNNmIiJl9YZTnXH5UUaM/TEtxQwPtBuboNMWTWkA2lCefv8Ta8zcn7 HAVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WYSObYj72OC8hVKwlWxoWFX95GbTM3VKXeoR98UYA4Y=; b=Zh8+xdbeGbC+9e1w7j4mZiJmUh1axwiDfxTxcXnWQ9A27FiJ4K4N9H+qXUwTRc37bl bSmOXW/ASWKdE6t6SFGtqhbZkEbbBtN6zsQhhEClwmwIVbfKK+witduFQmpz7Rxyab21 FnNc6okZ3ytE/UlPFfuo74GeUqJuQ2qwFL4wxNW8PtHOlijLCHj53yEam59fzgI+Ralu e5WuHGxqCri3qJ6RG4M8PYgTaSrIyc78n8DD8fFCVkvoNBkoOkc9OrcpiBY3PnxljNCH q8sFkoRtKGOa9fMdTc4wM3iGc3hLkZK0YGy/BpRF4b/Nan1aYFJuCsqif9Q6MUnx0CUs AeSQ== X-Gm-Message-State: AOAM533nmUkHaeBNl++KdrlFKhLFZDUMAYG+No2/PEHhgDFQNjrPcZlt Mq4lKZaViNPjQt/HrTRU2649oUmew81vVIg8hEE= X-Google-Smtp-Source: ABdhPJxxDIV4KZyYcReFelJ2SRUOpFNDlGackohx+VxK1LHz+Oj0pxtBYRVWVAhKnWn81HJyvk6rkowycjuxQjaIyko= X-Received: by 2002:a05:6402:2790:: with SMTP id b16mr10640ede.115.1622729727296; Thu, 03 Jun 2021 07:15:27 -0700 (PDT) MIME-Version: 1.0 References: <06f92428-a426-0afa-72ab-053e224a87ce@seld.be> <4c8f7ea1-6112-8046-846c-b701ab707752@gmail.com> In-Reply-To: <4c8f7ea1-6112-8046-846c-b701ab707752@gmail.com> Date: Thu, 3 Jun 2021 15:15:16 +0100 Message-ID: To: Timon de Groot Cc: Jordi Boggiano , PHP internals Content-Type: multipart/alternative; boundary="000000000000f6468d05c3dd3439" Subject: Re: [PHP-DEV] json_encode indent parameter From: george.banyard@gmail.com ("G. P. B.") --000000000000f6468d05c3dd3439 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 3 Jun 2021 at 11:49, Timon de Groot wrote: > On 3-6-2021 10:00, Jordi Boggiano wrote: > > I agree, but I'd make it accept a string|int much like JSON.stringify > > does, because that way you let people pass in tabs too, or "=F0=9F=9A= =80" if > > that's how you want your JSON indented.. > > I like the idea of accepting string|int. > > Accepting string|int means a zval needs to be used, with the possibility > to pass any type of variable (please correct me if I'm wrong here). > Should the function throw an error when it receives anything other than > a string|int? > That's incorrect, as of PHP 8.0 Fast ZPP has a way to deal with the most common union types, including int|string. Best regards, George P. Banyard --000000000000f6468d05c3dd3439--