pint icon indicating copy to clipboard operation
pint copied to clipboard

Pint fails on `use` with closure in 8.4

Open simon-tma opened this issue 1 year ago • 1 comments

Pint Version

1.19.0

PHP Version

8.4.2

Description

When running Pint on PHP 8.4 we're getting Cannot access offset of type null on SplFixedArray on the reproduction case (Index invalid or out of range on the original file, before narrowing it down to this specific case).

We don't get the error on PHP 8.3, if we remove the contents of the closure, remove the use() statement or if we add a return statement.

Steps To Reproduce

<?php

function () use ($bookings) {
    get();
};

./vendor/laravel/pint --no-config --test test.php

simon-tma avatar Jan 02 '25 01:01 simon-tma

Pending https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/milestone/173

crynobone avatar Feb 08 '25 01:02 crynobone