0) { $batches[] = $current; } return $batches; } test('array_chunk reproduces the legacy flush batches', function () { foreach ([[], range(1, 1), range(1, 999), range(1, 1000), range(1, 1001), range(1, 2500)] as $ids) { expect(array_chunk($ids, 1000))->toBe(issue7264_legacy_flush_batches($ids)); } }); test('chunk ids are integer-coerced before the IN clause', function () { $chunk = array_map('intval', ['5', '12', '88']); expect($chunk)->toBe([5, 12, 88]); });