Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130286 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id C4D821A00BC for ; Mon, 9 Mar 2026 21:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1773090321; bh=0o1FF6M5A9fdB/LnfqNTmPGrLTyOp8ACslyJTsdyAqE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bxFyo0oVrvPO6iKW0uPAvfLaaihCrxVy/mzEKHHFGOyYFqSm54RxFgKXP5l6n2a7q eYHNiDqYxgRIK9a4nFhtiLnAdMT4sxN4rvu6GxZuZwe/hpPPRVQHRpizXTC6UW85qO D4ag/kSNICh1OkWvSFlrDSjd+sHJeTEguZOysYMZztXM1p22xOe93JCgPTSm2d+UZr dvc6wrhcOvmprPv++e+KuM+FvczWkJJUvT9d614obNOlmXG/lyATzIQJsimCeuIBbZ 0Vrp0yl9ZzfdDtroKVmf9c6kW56vueJm/sl0FrXeFqFFHyHyHGmMDMZbsmKmLD/ch1 41acHI/jZvgpQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF942180545 for ; Mon, 9 Mar 2026 21:05:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 9 Mar 2026 21:05:20 +0000 (UTC) Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-50905b779dfso28366591cf.3 for ; Mon, 09 Mar 2026 14:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773090315; cv=none; d=google.com; s=arc-20240605; b=Zd2xO1hJ6sYLArD15rdmeiOvIx8SwpBVBiMbZP5gshRH8anNCwQM09hDc3v0VRZWli 8JcHXJv7+DTcwXjMykrKXqIMa0gILDsc6/sh9XDNVzXa6FR2yJz+gina+2pcqaCpM5K3 cEw+EpucsEKG6mr55wVfG2RFQk+C7Oz4PiL9p0AhTa/SSCuI7avZK2rC5rw+PDX1S7Wa MlbDQvr4DeHznkGqt31yV9tEEuy+jc/O1v/mJFjlX6m3k2biQ7S6cDStZ6JMo/ANo1qu ukozV0Vooh1PTbmnbLXg1dGT4q2PranURfOaSyY5iIGlSmuEoRXiuObFQCiBshIDCguK 0Drw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=0o1FF6M5A9fdB/LnfqNTmPGrLTyOp8ACslyJTsdyAqE=; fh=0GxiQxMs9WqjJbUc0g4Lo+MtFgejQw6hvWgjeVa3TB0=; b=e8sAlHi82zHGSielTY7T89coxYzsteucmYjT4yXiskdU9kmYWeYWs0/gfTys4A3+0i 1eHhj4crRpNAkAz30R8RRhaVnw14k2s71V1og9QpKVv74s7krYfJI3pViiBTfAEwAoSI ygtBiFLKnKimUH/1kNpAoDRWem8YRVnVXaZ8dNSBcgNYV1UpqaiYhgNzoVTUl2CdWaYz 7Ujn0Qlh9wXPJkLo1CEWedN040l9C8tctGyMc4sfDylaxF6MtJHuTjxId/3dZAeOuQ7f EZtjql53tvtDOsMQaEuxL5/Vc/QBYetshqVj89HZcVRO7i18jJMRPu18CdUk2xi2yif4 sa4A==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773090315; x=1773695115; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0o1FF6M5A9fdB/LnfqNTmPGrLTyOp8ACslyJTsdyAqE=; b=PxK+9ZLVq1JdU9/flK3oCgAjKzgzCJT9Rx4vbfS8FV0Cd5TDSqahH+ZTQ90GtN3K9K llI5Q1sN6l1Clx53df/s+t7c1jfI79G5kiAVBZts8MyDapiK/gHOechds0zPPhlyekY+ wbop4EXbM/vuS1N6Ewwwv4CAW0Wo8v207B+vC4BbQwxw88WJFE1rOlyu/1CZ2mJZdIrT 6S7kuxsdd026Vb8aWg18BtHCENkhKgwE8yj2KJrlVjqZqmzR1+9lbOOtPjKRmVPXtgXn LnzfZxmSGdNDySeli56DKLhfWL2iv4VkdlOB/BKWfsrMt2P5I1XWPUPr8OIKXLc+Mq2i ecbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773090315; x=1773695115; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0o1FF6M5A9fdB/LnfqNTmPGrLTyOp8ACslyJTsdyAqE=; b=BW3bmuVsREKyGZjsQ6owLI/gSXeSLpK0PN0l7vUROhXGScjCY9mmAQXk0R48qa65Yt FCKnAsAcv+FhVtpqgd0Oio0/Fl6TKJtiQ5OghHXDMQCT7knuYLHfCsPtZQvfBHHW4Hep klUTrrNHF/ymVPE60mSF47bxoZUATq2LCB8buSh6uOTmJHSUE5Xh61/1JRUn0tg7VPFu S/lamj8MXExhsPFDjP9qjlNTDBb8JVqSbzomZ05prkQZaYlpm7kRKz2x10gkVNr1y3t2 DWAGkV+cnmXJVt7NGpd7P2++Zy++s+RMFNlhMuuzWvhDJQmNXasTdOlYMx2ZIHTxi+kM fDVw== X-Gm-Message-State: AOJu0YxWuGSwDNNDiyIXbw+7tuGLk1Z3i0qVHPcV5w1jMYHfBagp8oEc fwvwnWO8B4lTmpW+CQBK5V5v0F5yxAiC27WjKk4SbDTKQNXlmdcpiogFTkdkQnUFaIArG/g44ki cwd/ycRdCfWw26+7BJujBWtPtqWxvysdYtmUv X-Gm-Gg: ATEYQzxgystzBqQbZ8g2RU7bRVMqp4+rjU4Alp018tq6lCG8RrmA0HvRFwI5Fz+27wW U+Hilo1BKkLiAiDnmw4uy2V27bzY3WxpAjZ9J9TxeydrSOuo/USlQTsAFsOsr1i0WjAptH06lMs 7sATrvbPHwlLNKve8lqRjV2vjoJ7o7ybG5xJetGZV1IEyN8X/CmpxxheIpvJOnxTb5XhBySSCG3 jMqIuBD2ynL/z8kbscyV0oLhxkhX9SKVamImra7VTnkwv6EksiRWVG6NAFysxlmVQUkNpwU8SyN LlZrCXfoWk2aFFXJ5g== X-Received: by 2002:a05:622a:2c01:b0:508:faa5:4512 with SMTP id d75a77b69052e-508faa54b7amr108261841cf.50.1773090315004; Mon, 09 Mar 2026 14:05:15 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 9 Mar 2026 22:05:04 +0100 X-Gm-Features: AaiRm53VYGvyd0Oo-moClZDtrvgp5njKwBn5NG1wxGDDvJnEy4Y3Q8ad18Urnv0 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Query Parameter Manipulation Support To: Jordi Kroon Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000616e35064c9dc28a" From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000616e35064c9dc28a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jordi, In the examples you mention the usage of `parse` and `toString`. I assume > there is no =E2=80=9Cdefault=E2=80=9D and this is a placeholder for one o= f the given > implementations. But it=E2=80=99s perhaps better to pick one of for the e= xamples as > it suggests it would also exist. > Ah, thanks for the info! Most of these were omission in fact, as I forgot to update the original method names after I unified the two QueryParams classes. > When it comes to the implementation I believe it would be nice to also > have a `getKeys()` method. That would only return the keys. > > You do mention the focus is to move away from $_GET. I like the idea, but > implementing QueryString would still require something like the following= : > > Uri\QueryParams::fromArray($_GET); > > If we really want to make `$_GET` obsolete, wouldn=E2=80=99t it be nice t= o have a > `fromRequest()` which would directly parse `$_GET` or use > `$_SERVER["QUERY_STRING=E2=80=9D]`. > As far as I can see, Uri\QueryParams::fromArray($_GET); wouldn't be needed. Do you have any use-case in mind where the suggested "Uri\QueryParams::parseRfc3986($_SERVER["QUERY_STRING"]);" call wouldn't work instead? I'm not against adding a fromRequest() method though if others find it useful (I'm a bit neutral about it). And I'd probably use a fromCurrentRequest() or a similar name to highlight the fact that it uses the current request as source. > As for whether or not this should be a readonly class. I think it should > be. The class itself is following various specs. And since all other > classes in the same namespace are also readonly, it should follow the sam= e > principle (also for consistency) I believe. > I think the most problematic case is to return a mutable class from a readonly class (e.g. Uri\Rfc3986\Uri::getQueryParams()). So we should eithe= r omit this method, or make Uri\QueryParams readonly indeed. Regards, M=C3=A1t=C3=A9 --000000000000616e35064c9dc28a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Jordi,

In the examples you mention the usage of `parse` and `toString`. I assume t= here is no =E2=80=9Cdefault=E2=80=9D and this is a placeholder for one of t= he given implementations. But it=E2=80=99s perhaps better to pick one of fo= r the examples as it suggests it would also exist.=C2=A0

Ah, thanks for the info! Most of these = were omission in fact, as I forgot to update the original method names afte= r I unified the two QueryParams classes.
=C2=A0
When it comes to the implementation I believe it would be nice to also have= a `getKeys()` method. That would only return the keys.

You do mention the focus is to move away from $_GET. I like the idea, but i= mplementing QueryString would still require something like the following:
Uri\QueryParams::fromArray($_GET);
If we really want to make `$_GET` obsolete, wouldn=E2=80= =99t it be nice to have a `fromRequest()` which would directly parse `$_GET= ` or use `$_SERVER["QUERY_STRING=E2=80=9D]`.

As far as I can see, Uri\QueryParams::fromArra= y($_GET); wouldn't be needed. Do you have any use-case in mind where th= e suggested
"Uri\QueryParams::parseRfc3986($_SERVER["QU= ERY_STRING"]);" call wouldn't work instead? I'm not again= st adding a fromRequest()
method though if others find it useful = (I'm a bit neutral about it). And I'd probably use a fromCurrentReq= uest() or a similar name to
highlight the fact that it uses the c= urrent request as source.
=C2=A0
As for whether or not this should be a readonly class. I think it should be= . The class itself is following various specs. And since all other classes = in the same namespace are also readonly, it should follow the same principl= e (also for consistency) I believe.

=
I think the most problematic case is to return a mutable class f= rom a readonly class (e.g. Uri\Rfc3986\Uri::getQueryParams()). So we should= either
omit this method, or make Uri\QueryParams readonly indeed= .

Regards,
M=C3=A1t=C3=A9
=C2= =A0
--000000000000616e35064c9dc28a--