wrap($arrays->arrayOf($plugins->loadClass("java.lang.Long"), 1, 2, 3, 4, 5)); // 计算累积索引加权和, 累积索引加权和: [0, 1, 5, 14, 30, 55] $numbers->runningFoldIndexed(0, function ($index, $acc, $element) { return $acc + $element * ($index + 1); })->forEach(function ($it) use ($console) { $console->log($it); });