📅  最后修改于: 2022-03-11 14:54:47.896000             🧑  作者: Mango
$collection = collect([1, 2, 3, 4]);
$filtered = $collection->reject(function ($value, $key) {
return $value > 2;
});
$filtered->all();
// [1, 2]