Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123851 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 929641A009C for ; Tue, 25 Jun 2024 22:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719354077; bh=5N2rCTa+94Uu73yWcHiSUcQnyA5jPYiPyZ2qMix9ZzY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=B1hdyTWev05HppTs9CdMTrauk1YET9wHAXgDlVYAOW7uAc7t3QPxt2jCTKciS3c+V /+hVkp8ez2tK+m/7YpTxO3+r5U3u5NFKlWdt9sW6oPa7E8k3GrCNCks+5sAIs5LcNd wWeCYJEFSvzSWjng0fs7qgcwSzOX907O7nKUhN0TeJEhe7crP34w/rMsI5jffsz7ZI KP8Ae3y8I6jx98jUfZklMhvwrpom9b7FRRGSgmQJSQZEDniqe2In2lIObhC9PSj/nt V4tixdBHPaTIdtjEYN3STt+LT/bPpLJNHQ2VKf6GX+bROYsl3v/MvrHLXrJ9/1szWH XWshePeaiKyXQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 33837180C1D for ; Tue, 25 Jun 2024 22:21:15 +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.8 required=5.0 tests=BAYES_50,DMARC_MISSING, SPF_HELO_NONE,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 franklin.smtp.mailx.hosts.net.nz (franklin.smtp.mailx.hosts.net.nz [43.245.52.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) 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 22:21:14 +0000 (UTC) Received: from 222-152-65-7-vdsl.sparkbb.co.nz ([222.152.65.7] helo=[192.168.1.67]) by franklin.smtp.mailx.hosts.net.nz with esmtpsa authed as varteg.nz (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim 4.96) (envelope-from ) id 1sMEW1-006PQq-2X for internals@lists.php.net; Wed, 26 Jun 2024 10:19:53 +1200 Message-ID: <8088812c-27f5-4c30-baaf-57d36af1ec08@varteg.nz> Date: Wed, 26 Jun 2024 10:19:49 +1200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching To: internals@lists.php.net References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> <1E295280-619B-4490-B53C-0899B64F9215@chaz.works> <97a93ae2-5202-47eb-bf51-ec1e976ea765@app.fastmail.com> Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Hosts-DKIM-Check: none From: weedpacket@varteg.nz (Morgan) On 2024-06-26 08:24, Rob Landers wrote: > On Tue, Jun 25, 2024, at 20:23, Ilija Tovilo wrote: >> If null array values were indeed unobservable, then [] would be === to >> [null] (or at least ==), and a foreach over [null] would result in 0 >> iterations. But neither of those are the case. > > I think there is a difference between an empty array and a null, and > that is (hopefully) self-evident. I’m talking about the 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 > What about the difference between an empty array an an array that 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?