Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115644 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87572 invoked from network); 6 Aug 2021 14:37:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Aug 2021 14:37:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E7EAB1804CF for ; Fri, 6 Aug 2021 08:06:58 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 66.111.0.0/20 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 ; Fri, 6 Aug 2021 08:06:58 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D7CE55C013A for ; Fri, 6 Aug 2021 11:06:57 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Fri, 06 Aug 2021 11:06:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=rRTsEz h6YzbFuvC/tCd2gKYaUHQ0W5lO0OB4DEZ/SbQ=; b=lrmUoL++ZJEMZtqB3g5uwF U5R8B4iOu9MlqFnjsfAzROD8rE8JxWnStfAYOJkRBTljsxCqmkQCKh/DcpNCfIXF bbX+04V7RNFtfFe72acuDL6IO9X+aLrvFoqP8qCQgzm3a7GR5dhiBV+Ymvg09t9o t2eUH3fXkC5E7VnbUG+30Dn08oSYM4XJAgf/K/TbWpM4jsvWsYNg1qWwPWWd4F+R QkHKA+FWh0/AebGJymrKppJS7pH2g94mwgDqHbNpin6jqaDzX8NFxZyvfK0iKMuh 74/rfrPSQLE+gylXC1EoNymWL+X3OquZ+SMWk5F4C2ixrtYp4CZDChYeMu9TiQ7g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjedugdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderreejnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepgefgueeludekffelfefftdejleduuedviefftddugeeg veejjeffleehvdegkeffnecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgv lhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 82855AC0DD0; Fri, 6 Aug 2021 11:06:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-552-g2afffd2709-fm-20210805.001-g2afffd27 Mime-Version: 1.0 Message-ID: In-Reply-To: References: <7DA18959-3463-4AAE-ABE3-B9330FEE83D2@gmail.com> Date: Fri, 06 Aug 2021 10:06:12 -0500 To: "php internals" Content-Type: text/plain Subject: =?UTF-8?Q?Re:_[PHP-DEV]_Re:_[RFC]_Add_parse=5Fquery=5Fstring_as_an_alter?= =?UTF-8?Q?native_to_parse=5Fstr?= From: larry@garfieldtech.com ("Larry Garfield") On Thu, Aug 5, 2021, at 5:21 PM, Kamil Tekiela wrote: > Hi Internals, > > I have added implementation for > https://wiki.php.net/rfc/parse_str_alternative. If there are no other > comments, I would like to start voting on Saturday. > > Regards, > Kamil I will be voting No on this as is. Not because I'm against improving the query parsing tools; I'm in favor of that. But as noted, this RFC doesn't do enough to improve it. Returning a value and changing the name isn't enough to justify another global method. As others noted, the parsing rules themselves are fugly and need to be improved. More importantly to me, though, it is the year of our lord 2021, and PHP APIs have no business pretending that arrays with possibly-missing values are a data structure. They're a satire of a data structure. If you're parsing a string with known structure into something, that something should be a properly defined object. The new PhpToken is a good example of that shift done well. Don't give me an array where I have to mess around with isset() and crap like that. Give me a properly defined HttpQuery object with named, type-enforced properties and meaningful methods. Give it a parse(string) static method and a __toString() method to convert back to a query string. Anything less is, frankly, not worth the effort. --Larry Garfield