Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130219 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 5BCFD1A00BC for ; Sun, 1 Mar 2026 22:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772405888; bh=AZhG//QK+7IilhOmHPwD8NJWCqe+RfRUtX8nral2oys=; h=Date:Subject:To:References:From:In-Reply-To:From; b=mmSMFtDynAEmusPaqLQ4bgo7Wm46TOZZVKTmT2vQGH6U3O9Ng2UYw18GV8Q9mT/I5 /+sNyS2SReD0LafTbu3joh8x9c/n9Q8qKbquBUXQYOi/nmdeDQTfrD9uf5Dr3atfr9 wbqy7ZmgzD4aWC6LohUultlr4sSTw/VayEssuTwgVT/vOvh0e9Cvk582521IzSJOTv e5hCnpesVYsCRtTe3sorYFBe6gaLRIQMwNuRYqeCZBXPhtUxYf39viqsGRYmsMGjWw J9yS1yfYvQBxoud3S9Sw7La9GC6uaIQjJ3olbck0ITI7wVc0mFOJhwx5dP3BK6SzTt 3lUupDSNOaP5w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3C1F4180212 for ; Sun, 1 Mar 2026 22:58:08 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Sun, 1 Mar 2026 22:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1772405881; bh=JHirYZjvmoVVv0sc2JH34/igic9uaGfoVfsa+y8n/U0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=ntQz3o05lHmdukDz93zL9tb9qLd5Ze6KDcYwi2UIFJmzMug8K+tUVpWa+1D/mTEwK bH3EIVxgdqmJIyhggrRbJluMjchoybwKJV/SRi8U+XmEWunpi8Pz5PrC2N0vuRJ6wN MuBGWu4Bb5lWyAUK0W2O909O2Cb1jKqmWT0K2U+It/9Q/uVg4iv2JDoxJTJ7A6qL0o hY6QbL18NVQK03brv292hAUz3rZfN3Qump5MRn7zZ1QxdllL4w/s/sWjWUjSY/i8qO AFWqPZDNEwTfd0rtNzEdq9SXsikJMRyko2GznvLihyZXMyLEiujnLerP4rhlvGdzO4 aftGfMq/V9D5Q== Message-ID: Date: Sun, 1 Mar 2026 23:57:57 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] [Discussion] Query Parameter Manipulation Support To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 3/1/26 23:31, Máté Kocsis wrote: > Other than the API itself, the proposal doesn't have many questions, except > one thing: whether the new class should be readonly or not? I tend to make > it readonly, but I'm still not sure (since > this class can be used as a Builder). I don't think it is as necessary to make it readonly as it is with the URI classes, since the query parameters class is likely to be used for “local modification” and is less likely to be passed around as a value object. If efficient copy-on-write is possible internally, then making it readonly is the safer choice, of course. With regard to the RFC text, I've given it a first quick skim and have the following notes: 1. Within the "Relation to the query component" section. The `$uri = new Uri\Rfc3986\Uri("https://example.com?foo=a b");` example is invalid. An URI containing a space is not valid and the `Uri` class will throw an exception. Can you double-check that part of the RFC? Without looking it up, I suspect that the space should be `%20` for RFC3986? 2. Within the "Modification" section: “Neither append(), nor set() do any percent-encoding or decoding of their arguments.” This should explain that during stringification, the `%` will be encoded as %25. Thus the example will result in: foo%255B%255D=ab%2563&bar%255B%255D=de%2566 3. Within the "Modification" section: “Finally, sort() sorts the query parameter list alphabetically:” It is implied by the example, but should be spelled out explicitly: Parameters with the same name should keep their original order and should not be sorted by value. 4. Within the "Supported types" section. “The above conversion rules work for both UriQueryParams and UrlQueryParams.” and the examples also use Uri\Rfc3986\UriQueryParams / Uri\WhatWg\UrlQueryParams. This seems like an oversight from the original implementation, since there are no longer separate classes. Can you double-check the entire section? 5. Within the "Array API" section. This also uses Uri\Rfc3986\UriQueryParams in the examples. 6. Within the "RFC Impact" section. The ecosystem impact can probably be “None”. --------- I'll give this an in-depth read later, when the obvious mistakes are fixed. Best regards Tim Düsterhus