Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115639 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58683 invoked from network); 6 Aug 2021 08:59:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Aug 2021 08:59:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9207F18050B for ; Fri, 6 Aug 2021 02:28: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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS13238 77.88.0.0/18 X-Spam-Virus: No X-Envelope-From: Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 6 Aug 2021 02:28:43 -0700 (PDT) Received: from forward101q.mail.yandex.net (forward101q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb98]) by forward103p.mail.yandex.net (Yandex) with ESMTP id E647618C01BB for ; Fri, 6 Aug 2021 12:28:40 +0300 (MSK) Received: from vla5-396535d496ca.qloud-c.yandex.net (vla5-396535d496ca.qloud-c.yandex.net [IPv6:2a02:6b8:c18:341f:0:640:3965:35d4]) by forward101q.mail.yandex.net (Yandex) with ESMTP id E18DECF40002 for ; Fri, 6 Aug 2021 12:28:40 +0300 (MSK) Received: from vla1-ef285479e348.qloud-c.yandex.net (vla1-ef285479e348.qloud-c.yandex.net [2a02:6b8:c0d:35a1:0:640:ef28:5479]) by vla5-396535d496ca.qloud-c.yandex.net (mxback/Yandex) with ESMTP id cPmztSgEer-SeHGTsHi; Fri, 06 Aug 2021 12:28:40 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.watch; s=mail; t=1628242120; bh=cbcfMyZppOPJ1BdY7p7Vk+xdz660/6olGt+YxaCctmM=; h=To:Subject:From:Date:References:Cc:Message-ID:In-Reply-To; b=lux9ppydy8FwzCjGiI7yoKUBJ37TkbUE2OR/q+MHLL1z+1+ZiL5Lg5GA9vL9UqYFM YD4dQ8I89Ez57n8bXRYa25j2BId9oiZQP/5AFmR2saA0Gx96DvwooyCCnZTx903V2k gj1jgCSzzb0cWGaAMYk0M5F24AYP/+GjCqahKbXg= Authentication-Results: vla5-396535d496ca.qloud-c.yandex.net; dkim=pass header.i=@php.watch Received: by vla1-ef285479e348.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id Ja0ma8AJUH-Se8O7ubX; Fri, 06 Aug 2021 12:28:40 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Received: by mail-oi1-f171.google.com with SMTP id n16so11299092oij.2 for ; Fri, 06 Aug 2021 02:28:40 -0700 (PDT) X-Gm-Message-State: AOAM532gFXRrks+LoxDrgLcH9hFRGASAdCiYgbclxFezYy3smRZEs2ZG 4y5KG0hxFblKl1MhQ7hIizND97lq4bObIZPz+X8= X-Google-Smtp-Source: ABdhPJz9KlQy7uctUnfi7/ZznOUGfLaD4V4AEQETHrXwGKCaYYpb8hCfoAD0fJnnzF+6Udxmx27DYLeLmW94gKZbyX8= X-Received: by 2002:a05:6808:1386:: with SMTP id c6mr5574844oiw.18.1628242118847; Fri, 06 Aug 2021 02:28:38 -0700 (PDT) MIME-Version: 1.0 References: <7DA18959-3463-4AAE-ABE3-B9330FEE83D2@gmail.com> <0def35e8-f527-3362-2821-2535bc16f8c8@alec.pl> In-Reply-To: <0def35e8-f527-3362-2821-2535bc16f8c8@alec.pl> Date: Fri, 6 Aug 2021 14:58:11 +0530 X-Gmail-Original-Message-ID: Message-ID: To: Aleksander Machniak Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Add parse_query_string as an alternative to parse_str From: ayesh@php.watch (Ayesh Karunaratne) > I agree about the _string suffix removal. However, I know we have > parse_url() already, but parse_query() might be too generic. I would > suggest adding "http" to the name. And as we already have > http_build_query() I would rather see http_parse_query(). > +1 for http_parse_query() as it sounds a lot more natural and consistent. > parse_str assumes that the query separator is always a "&" which reduces > its usage to only parsing query using that particular character. Again this > might be seen as an edge case but no RFC prevents using any other > character. If you where to use another character you are bound to use some > userland code workaround to then feed the "normalized" string to parse_str Both `http_build_query` and `parse_str` respect the `arg_separator.input` [INI setting](https://www.php.net/manual/en/ini.core.php#ini.arg-separator.input). If we were to go for a `http_parse_query`, I think it makes sense to support the same behavior and parameters. Thank you, Ayesh.