Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123860 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 397EB1A009C for ; Wed, 26 Jun 2024 07:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719388708; bh=rebdJG2yAkAPlAenZgjsIMi9G6L4Umc9ISzWKsV/Gow=; h=In-Reply-To:References:Date:From:To:Subject:From; b=cWVSBgrO0j27E+YuWK96bygJCRJye/G8tRDnoX2my2kfu6vDvQfJ0adnVvRXyf9bN JT6Z7Ry2qGqbWOokOEICahg3AakXmIX+sMDAaIcu+Hfu8TNYwd+OZ0bOqQ1aHU30b0 0kqu8vr1YGVCE/YdflLi6y7UMQGaEXAzYQQYe4fyyN+y7ABnNFuKDnNrmCjaXop4RP GdoauijP+iH8Kq9Gnqh5zDFpz6KQeESwPX/LNyrW51GbS1+agW2i8ZZU08FFqpzTEf 8xI/mgjr1oSOzDTU437FIjP1DbjoGj5t4H9zfF3TW6aWjkQpWGOYxpESBgmC2qeKmR ZACenr9FTAEJg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 24C5D18003F for ; Wed, 26 Jun 2024 07:58:26 +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,HTML_MESSAGE, 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 fhigh1-smtp.messagingengine.com (fhigh1-smtp.messagingengine.com [103.168.172.152]) (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 ; Wed, 26 Jun 2024 07:58:23 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 3B21C114037F for ; Wed, 26 Jun 2024 03:57:06 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute1.internal (MEProxy); Wed, 26 Jun 2024 03:57:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc: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=fm3; t=1719388626; x=1719475026; bh=rebdJG2yAk APlAenZgjsIMi9G6L4Umc9ISzWKsV/Gow=; b=Sj3n3IHWBq68LVFoA0l2BIU/n+ BgUHngOIUSWVHUp1v9bgg+4WlZzeJPkl3wVdMLY6q79XFxqVaX23xcg+CzqpFz0o xhrZneR58ivk9rvkrMy2nZMDVyaW7Kn3QPVDwocjNyTs04/SGhoK3PWGwZxNBYXS kqHpOkqWAkBXPSB6zl+TJILeGcELW+WyD7YOzA1uuNwi+bDEvIXqdKEZ6Wexl908 nWYUIrTZtyxZbbRrNpVA0YFrxACVvHAr5k5eWK3CiZupp7nwQbzDe3niqH0/mFq9 KNcor3qskAiavW4e0f5Brb6p4Omi2uz3c0jNDf4XzMtX3oq1hJVycza5tzNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1719388626; x=1719475026; bh=rebdJG2yAkAPlAenZgjsIMi9G6L4 Umc9ISzWKsV/Gow=; b=kNbj8maG4qsZsITTM7J0+34RM0hav8sZNp8h0n7YUD+a HMBLUUI0zeIaMSp8ks6qNhGPfova1QEDtxBneV7cjTqWgR6BCxiEuv/+CMFSmpfS wG/U0sHr+6zGsTQXa1jUGbNpGEHaPYPrGfxrbf2xxF4G0u3bIM1F0qeR/+ydfwRY blKPssEO+L9CuWL9qWZzzrhN9jm0kL6GeZ/MT8FMA+ZxA9w7pQm03TEfj3nGggrf prFJh0jqn7qxmnCL3YXuA99i7WrjjENvQNPvTqGanddACMeM9ZU3lZ8cOmtwoKEt dXhPhsEHoQa5KRNE4Fodtkczc+FgWWzzrqyOkT0AOw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtddugdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerreejnecuhfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessghothht lhgvugdrtghouggvsheqnecuggftrfgrthhtvghrnhepfeefudfhudduieekkedugffhud fgleejgfekgefhvdeikeelvddvjeehteegteegnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvsh X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E6F6F15A0093; Wed, 26 Jun 2024 03:57:05 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-538-g1508afaa2-fm-20240616.001-g1508afaa Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <5e7f4e03-d7ff-441c-97b1-42a69e6543a1@app.fastmail.com> In-Reply-To: <54ec7ee2-aef2-4e70-accd-e94babbb2e48@app.fastmail.com> References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> <1E295280-619B-4490-B53C-0899B64F9215@chaz.works> <97a93ae2-5202-47eb-bf51-ec1e976ea765@app.fastmail.com> <8088812c-27f5-4c30-baaf-57d36af1ec08@varteg.nz> <54ec7ee2-aef2-4e70-accd-e94babbb2e48@app.fastmail.com> Date: Wed, 26 Jun 2024 09:56:43 +0200 To: internals@lists.php.net Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching Content-Type: multipart/alternative; boundary=b90a997ac0054fa3a7f9f284aabac60b From: rob@bottled.codes ("Rob Landers") --b90a997ac0054fa3a7f9f284aabac60b Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 26, 2024, at 09:54, Rob Landers wrote: >=20 >=20 > On Wed, Jun 26, 2024, at 00:19, Morgan wrote: >> On 2024-06-26 08:24, Rob Landers wrote: >> > On Tue, Jun 25, 2024, at 20:23, Ilija Tovilo wrote: >>=20 >> >> If null array values were indeed unobservable, then [] would be =3D= =3D=3D to >> >> [null] (or at least =3D=3D), and a foreach over [null] would resul= t in 0 >> >> iterations. But neither of those are the case. >> >=20 >> > I think there is a difference between an empty array and a null, an= d=20 >> > that is (hopefully) self-evident. I=E2=80=99m talking about the inf= inite nulls=20 >> > IN the array. You can write a for loop of all possible keys until t= he=20 >> > end of the universe, and all you will get is null. This is fairly e= asy=20 >> > to prove. I'll wait... :p >> >=20 >> What about the difference between an empty array an an array that=20 >> contains a null (Ilija's example)? >>=20 >> echo count([]); >> echo count([null]); >> echo count([null, null]); >> echo count([null, null, null]); >> echo count([null, null, null, null]); >> ... >>=20 >> You're arguing that these are all the same array? >>=20 >=20 > If you are accessing them by index, yes, they are all the same array. = There is no observable difference. I think we already covered that count= () would show the difference between them since it=E2=80=99s actually a = count of known indices: Sorry, I=E2=80=99ve not yet had enough coffee, this should be: $arr =3D []; for($i =3D 0; $i < 4; $i++) var_dump($arr[$i]); >=20 > Will output 4 nulls.=20 >=20 >=20 > =E2=80=94 Rob =E2=80=94 Rob --b90a997ac0054fa3a7f9f284aabac60b Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable

=

On Wed, Jun 26, 2024, at 09:54, Rob Landers wrote:


On Wed, Jun 26, 2024, at 00:19, Morgan wrote:
On 2024-06-26 08= :24, Rob Landers wrote:
> On Tue, Jun 25, 2024, at 20:2= 3, Ilija Tovilo wrote:

>> If null arr= ay values were indeed unobservable, then [] would be =3D=3D=3D to
>> [null] (or at least =3D=3D), and a foreach over [null] = would result in 0
>> iterations. But neither of thos= e are the case.

> I think ther= e is a difference between an empty array and a null, and 
=
> that is (hopefully) self-evident. I=E2=80=99m talking about th= e infinite nulls 
> IN the array. You can write a = for loop of all possible keys until the 
> end of = the universe, and all you will get is null. This is fairly easy 
> to prove. I'll wait... :p

<= /div>
What about the difference between an empty array an an array t= hat 
contains a null (Ilija's example)?

echo count([]);
echo count([null]);
echo count([null, null]);
echo count([null, null, = null]);
echo count([null, null, null, null]);
...

You're arguing that these are all the= same array?


If= you are accessing them by index, yes, they are all the same array. Ther= e is no observable difference. I think we already covered that count() w= ould show the difference between them since it=E2=80=99s actually a coun= t of known indices:

Sorry, I=E2= =80=99ve not yet had enough coffee, this should be:

$arr =3D [];

for($i =3D 0; $i < 4; = $i++) var_dump($arr[$i]);

Will output 4 nulls. 
<= br>

=E2=80=94 Rob

=E2=80=94 Rob
--b90a997ac0054fa3a7f9f284aabac60b--