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?