On 30/03/2022 15:32, Guilliam Xavier wrote:
On the other hand, I agree that `$undefined[] = $x` looks like a
bug... are both cases the exact same opcode?
Some very good points raised in this thread about how many different
closely-related cases there are here. I shall have to think clearly
a
On Wed, 30 Mar 2022 at 15:33, Guilliam Xavier
wrote:
> Not really a "compelling reason why we should keep this inconsistency", but
> I have occasionally relied on array autovivification *for sub-dimensions*,
>
I rely on this often when remapping data for analysis. These scripts are
run a handful
Hi Rowan,
Not really a "compelling reason why we should keep this inconsistency", but
I have occasionally relied on array autovivification *for sub-dimensions*,
e.g.:
```
function f(iterable $xs) {
$map = []; // initialization!
foreach ($xs as $x) {
// $map[foo($x)] ??= []; not ne
On Wed, Mar 30, 2022, at 9:11 AM, Claude Pache wrote:
>> Le 29 mars 2022 à 21:44, Rowan Tommins a écrit :
>>
>> Hi all,
>>
>> If $foo is not defined, statements such as $foo += 1 and $foo .= 'blah'
>> raise "undefined variable" Warnings in PHP 8, and will throw Errors in PHP
>> 9. However, the
> Le 29 mars 2022 à 21:44, Rowan Tommins a écrit :
>
> Hi all,
>
> If $foo is not defined, statements such as $foo += 1 and $foo .= 'blah' raise
> "undefined variable" Warnings in PHP 8, and will throw Errors in PHP 9.
> However, the very similar looking $foo[] = 1 succeeds silently.
>
> T
On Tue, Mar 29, 2022 at 9:44 PM Rowan Tommins wrote:
>
> Hi all,
>
> If $foo is not defined, statements such as $foo += 1 and $foo .= 'blah'
> raise "undefined variable" Warnings in PHP 8, and will throw Errors in
> PHP 9. However, the very similar looking $foo[] = 1 succeeds silently.
>
> This se