bobthecow/psysh

Wrongly fails with the presence of [] in arrays

HeySora opened this issue · 2 comments

Psy Shell v0.11.15, PHP 8.2.4

This issue is similar to #759, but still different:

> $a[]['b'] = 'abc'

   FATAL ERROR  Cannot use [] for reading in vendor/psy/psysh/src/CodeCleaner/EmptyArrayDimFetchPass.php on line 57.

Removing the exception from that file works as expected (I know this isn't the solution, I'm just not sure how to fix this in the first place as I'm not familiar with the code, apologies!)

> $a[]['b'] = 'abc';
= "abc"

> $a
= [
    [
      "b" => "abc",
    ],
  ]

This also happened in v0.11.14, prior to #759 being fixed.

Thanks, this has been fixed and will be in the next release :)

Thank you so much for the amazing work!! 🧡