Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123845 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 qa.php.net (Postfix) with ESMTPS id 9C8411A009C for ; Tue, 25 Jun 2024 21:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719349904; bh=L615CrMoEw9wuFBMd6rRmgtBgB1DLjNiwt2MYr+dWtQ=; h=Date:From:To:Subject:In-Reply-To:References:From; b=BYkKwS4tCZVMxjpALuHEsBERY42Xc4nHaasYE6eb2zmhaa6iMyfN7rwhLNoWO/RZJ QrZdyovZhnWok0QGBcq3BvbnG6Tl6ex/ugmXswvhm/KsuuqM5mjwYzSm5X9BtIFHIn Vj4+Omo1k/AsTjRuxGsFLxGbun2N8VS1sGTIZgtDM4xyjJJTpySxz2/Kw8YTgaeK49 g75pbbpqJOzpeyV+LPRufMSp4jX8R1/6jKKA5ZJ7mJ91Z971ZzLLkmydq/2w7iF5OD qSidlWAYMUvPt01D7xulq9X7YMXklts0+oR/zc5fBg2eQPz90WjR6dR3UjKGfxEv9d OmT8n7EwJpEAw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 560DA180A3A for ; Tue, 25 Jun 2024 21:11:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh3-smtp.messagingengine.com (fhigh3-smtp.messagingengine.com [103.168.172.154]) (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 ; Tue, 25 Jun 2024 21:11:42 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 10C241140209 for ; Tue, 25 Jun 2024 17:10:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 25 Jun 2024 17:10:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1719349825; x=1719436225; bh=L615CrMoEw9wuFBMd6rRmgtBgB1DLjNiwt2MYr+dWtQ=; b= JRwZ0z7oVGyhC5paJ7yWKuCPMUBy+Aq97qlyOY8d1LuBxCUXnvP77Z7dMt6ZpMrq FhOnHwqN7qrRc+meWHcgVKpyPpoccCoELaP+kyCE7iYK9P3QWAn/SiWbzSQI7GTm kSdeKujFcqK0lJeU79KbRpzLCVgQXXKAcjed4+zRn0ihV9+CwdN6aR0rb+9b5d48 aaZzWRBdiItIFHiXj3Vhp8HDochkCwoOJUcVS9E1+s+K421bXLZjKINPUHoCWGrs ZMMFxLEqFjsaRid/uVd4ive2B7P0tHnLnZ/g2r6vNsSlZyirFavxQBgW4D2akagJ H9zL2TCkLFzC0saGvr1eaA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719349825; x= 1719436225; bh=L615CrMoEw9wuFBMd6rRmgtBgB1DLjNiwt2MYr+dWtQ=; b=P dywAf8im+2KC8IZwbt8b7rF22bzjqHB65T3w59ph9gblm9rrR6NVHrL4UbaiTO4a IfKdxQBXVN0dc4QlTUWgDaVeYsPTkQ+8PrP8hqUAvfAlI457qDuRfMrUozUUV+1n z2UurL7KDbrBcFXe1DK3EdbJV6ROqxp0eUMnPKLUTZPIZp4ypDzEaKHw2DxBhpl1 G6QiU1QsDZkuHICg7PWxT6yFf6qG76jp5cXQDhEqcQ/sHmB6LUgqshxo01Y5kau4 4pMq8V0aFEmRldUiJQmrk2dM1KGKmnv4j0FEZ+knWMmgLtM0p9ziLMrST/wNY47j IVoHB8+23e2U2iVi32kQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtddtgdduvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqh hmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdf uceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpe ehleffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtkeevvefgleenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprd hphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 25 Jun 2024 17:10:23 -0400 (EDT) Date: Tue, 25 Jun 2024 22:10:22 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching User-Agent: K-9 Mail for Android In-Reply-To: References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> <1E295280-619B-4490-B53C-0899B64F9215@chaz.works> <97a93ae2-5202-47eb-bf51-ec1e976ea765@app.fastmail.com> Message-ID: <78D0FFF7-3867-4D71-B0C0-FA23E5121C39@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 25 June 2024 21:24:32 BST, Rob Landers wrote: >The only way you=E2=80=99d observe this (that I can think of) is by perfo= rming a for-each loop over the array=2E=20 There are many ways you can observe the difference between an absent key a= nd a null value; here are just a handful off the top of my head:=20 - array_key_exists() (that's literally its purpose!) - array_keys() - count() (if the array held "an infinite number of nulls", we should retu= rn infinity for every array!) - json_encode() - print_r(), var_dump(), var_export() - extract() It may be questionable to give meaning to the difference in some of these = cases, but different it definitely is=2E=20 > If we don't like it, we can always create an RFC to treat non-existent k= eys as an error instead of a warning=2E I believe that is the explicit intention or desire of those who raised it = from Notice to Warning=2E It would certainly prevent some bugs where a typo= leads to the wrong key being accessed=2E Personally, I'd like to see a few use cases catered for first, like $count= ers[$key]++ and $groups[$key][] =3D $value; Perhaps by introducing some equ= ivalent of Python's "defaultdict"=2E Because I do agree that the current be= haviour is useful sometimes (even if I disagree in how to describe it)=2E Regards, Rowan Tommins [IMSoP]