loophp/collection
A high-performance, functional-style collection library for PHP. Provides lazy, immutable, chainable operations built on generators to map, filter, reduce, group, zip, and more. Works standalone or with Laravel, aiming for speed, memory efficiency, and fluent pipelines.
pair and chunk operation when using empty input #327Collection::fromFile constructor #322dispersion operation #320#321entropy operation #317duplicate example #315#312#311pair and chunk operation when using empty input (#327) #326ed5ef20b2ef168df8d3e981b1195437445580c7a12Entropy operation 138fc0e7be4f2946db7b8c1acfbb9bdd8569b4cf931101f3asort operation cc26a56countIn operation #306length parameter to fromFile constructor #307#308#3095321ebcDeterminateSystems/nix-installer-action 6a4374b.editorconfig d700df0range operation may now yield int|float instead of float 64ba910f346796fizz-buzz example 4d3d325groupBy example 55f1989#305#301#300#2991bfd964composer.json ff6299f309f4b013ef4873847ab02cdf12852540ff3c06179a081ef19ad6d0fd062040pcov extension #297#296#287IsNotEmpty operation #292reducing operations #288#28630682efclover coverage 5b510c20273e642a62cf2631a57fcd9b36d3aab1e1composer.json 70f95b65dd2a88find operation 50d416a1aca43629b0456unfold static operations a429c78531249e999c257foldRight operation f717078groupBy update typing information b55fec7groupBy b5662f4baseline 61f6367Matching operation, add inline SA annotations e9cc0f3755f8b3empty constructor 9a4b0bbfoldleft, reduce, update return types and tests 19907fcfoldleft operation c3a536b507175dlast operation improvements 7c60e2ctails SA improvement 8e3de94tails operation improvements 58c840bcompare minor improvement 5e46af0reduce operation static annotations 5c7d401callable into Closure f30c87areduce operation, use ReduceIterableIterator 884f64c0453ee36f320a608af31b3571e0c937740d92f778cextending collection section with code example 0c1d439c93f350#283AbstractCollection abstract class #270#275#276#274unfold constructor is not variadic anymore #269#266#267Reduce operation. #259#263#261#258Compare, Max, Min #255#253pcov for coverage. #252#251#250#249#248Averages operation. #238every operation #247phpspec/prophecy-phpunit. #246scanLeft1 operation. #245#244every operation. #242#243CallbackArrayReducer. #241#240#239#235Iterator with iterable almost everywhere. #233new keyword on some operations. #231StringIteratorAggregate. #234#227RandomIterator #230Generator - using IteratorAggregate. #229loophp/iterators #228#264Tails operation, performance improvements d71b2efUnpack operation. 34c36dac6b9164composer.json and fix auto-changelog command 6949831composer.json 1ba6085908d3e5Tails operation ea4b92cTails operation, performance improvements 1c28be3Window operation: minor performance improvement 486567atests for PHP 8 25067cbdocs for PHP 8 1d9c134src for PHP 8 4a4a60b4dc36feIfThenElse operation eb781328ee11347154f090e8b0e5d7bba3a808578aCollection interface use statements 6bbb829span and partition operations 31d4b31747e1f8unfold signature d11adddf78dc32Wrapable interface" 1cf67d1Wrapable interface 3866fe5template-extends annotations a3f8b45use statements 19eb14euse statements dce7e48cd4a6f6.envrc b402706c49e62bGroupBy static analysis annotations. d74d4f8473f105c1998e92fb44cfSince and Until operation - fix sa bde565cCompare operation - fix sa 06729d7ea90e236a275510dae4c269818b3pipe documentation ec10eebphpcs annotations a385a6adae9eb6ca6f6022d09f65bac7f9b376bd660f2db5b8d1296595e60b5e78546escrutinizer/ocular 583668f079a7b9a6653b8scanLeft and scanRight has been updated and now need two arguments instead of one. 9355dea1233c4925ed0506c5e44cdiff SA tests ece6067diff SA tests 0af490e28e76636ec05634197638e546136Pair operation eed0c7e2a0ed02Duplicate operation with Distinct de09c01806fa1831f87a82e50e49aacb5e998fe09aphpsandbox badge and link. 9f02c7c679b353flake.nix file. 8ddd35dd34980d7810400composer command to run the documentation server. 15dc6bda7833943f90ed6docker stuff. 88e92b6loophp/iterators^2. 1343255loophp/iterators^2. 691abd46f1eda34463a37fc3a790prettier in required status checks. c8687cf9551288.gitattributes. 411f9375ab0f1fa65faf4ff03ea6bbfb1c825d1c251ef0edcdistinct tests. 6147f9ctests src directories. ff8fea0distinct tests. edc521f7f43d4b738cc6eFilter and Reject operations. 186c003066504a25b2a69Pack operation. 32462adEquals operation, fix typing information. eff8102Same operation, fix typing information. 5a91d8aReduction operation, fix typing information. 466232bReductionIterableAggregate. 0d4d7a2ReductionIterableAggregate. a168b6d3b49c3a16e3c7a3017e2ac148d1631cdc99ConcatIterableAggregate. d90986dMapIterableAggregate. ea45575FilterIterableAggregate. 84b42c2SimpleCachingIteratorAggregate. 51e7d6f[@psalm-suppress](https://github.com/psalm-suppress) annotation. ab5f9f0a1873a7a6b4791447bd030e30363c835e1c679834b843c9c4Reverse operation. 545bd60ext-xdebug from composer.json for now. 6209f4b2ce3510f08d88ee9c44605987ab7random operation: use RandomIterableAggregate. 78e7a6f8afedbf7a050410d2595eEvery operations. f523cdbEvery operations. de1edb32a0c84df0612e7Head operation. 33e2f156cc2a05Unwindow operation. c9562fdTranspose. 38cca46new keyword everywhere. aacf7dfnew keyword everywhere. a6db56e35bf8c2new keyword everywhere. 8a3a05a79ebed1Drop rely on Limit now. 16e220ad6d8aa69ac298a11bee1519616a6669a9567af1d80.php-cs-fixer.dist.php. 0fba6da3b773ade19bde8TypedIterator - Add test. b9aab65cbc6c20StringIterator - Add test. fe15a5bStringIterator - Add test. a66242deb61a90TypedIterator - Add test. 7280ebc468d71df54b00204d753110e7eedUnpack operation - Use UnpackIterableAggregate. aaa289a741cbce8ef547dfrom keyword. d179b116df94eereturn keyword. 7683362782a48ed11214978d5d7a351676b58a3919Same operation - proper sign. 15bf8deSame operation must yield. 317b519Same operation, clear remaining todo. 518209bfromGenerator operation. b2e1dc9b2028d8DropWhile operation. e794b79Sort operation. 1935d11scrutinizer/ocular upload. 5f956e2525e32eContributing section. 36cdcd1scrutinizer/ocular upload. 5e6738020a13524fd27fd603eb82fed4fbcd11d032Intersperse operation - do not throw when values are negative. 1497db747eb342401cf20cf34e8dUnfold Operation #217#216#212All operation for standalone usage #215all operation to prevent data loss #209#214#207Find operation #204Current operation - Let specify a default value #205#203Flipable interface. #200#197a55e97a49d1673MatchOne operation - Add missing typing informations. f66b407MatchOne operation. 1e6ad7aRandom and Shuffle operations. cefe0f5Wrap operation. ef61f57#196#195#194inits operation #191Duplicate and Distinct operations in point free style. #188#190Init operation in point free style. #186combine operation in point free style. #187#184Transpose operation in point free style. #178Zip operation in point free style. #181Window operation in point free style. #179#183#180Collapse operation in point free style. #182product operation in point free style. #17705beff2RandomIterator types. 5a5ae1dUnpair operation return types. 885059f08199caf9b7c1cRangeable interface (to backport to master) da430f9Zipable interface (to backport to master) 7e47439Initsable interface (to backport to master) 711f3c7Groupable interface (to backport to master) 6c24b7eImplode and Unlines operation. 05bbf8eFrequency operation return type and minor optimizations here and there. a1964f4Transpose operation in point free style - add missing documentation (#178) bd0ec78Window operation. a2ee653#174Span and Partition in point-free #175Distinct and Duplicate operations. #168#169#164#171#170#167#166#165#163#153#162::fromGenerator constructor. #150#161#157#156Same #155Reduce operation #139Equals Operation #152#154stable docs instead of latest #151#148#146#145#143#144#141#142#140Reverse operation - optimize and remove todos. #138#137#136#133#132Map to only take a single callback #134#131::partition() and ::span() #124#130#127Reject operation. #125Filter operation. #12674d3069404d0b7c6488a45f4ef9eed3c09540cc177d8a8d50#122#121#120#115#117#111#114#112#113#109#108#106#105strict Operation #102#104#101#100#975edb9e7c7ba932c8ad46658d8035defb90377201ba997efd9023d399366c79bfb641e86a7f8c59d21114fb9fcd78921563717b364cd8ef323f18553#96#94#93#90#89#88#86#87#83#85#84#79#81#78drupol/php-conventions #76a53167d228831eafe71bfd31df6f6e5c75814253437247de4#72#70#68#69#67#66#64#65#63#60#61#71e4fa034fb542bedbb930771a7693730a6383c2d3e3c5a9e58cd0f8f89780bbd152447b5aa1d02f62085984ea356be4aec3e967e0127285f8b990edb406afee97f8479bc6d61e932704442197bebd8c40f51b24940d87d1551eff672797d5d0567c277705b94e5918356d2e65a0f2d09634d626c6c1430879d8b2a861cb9f7502dc088cae79e646c8c102a45d0a91335d1bdbdfc8c3d9b80e676bc7aebfe837bd76710c52fae36094#5845a46b8a7b6a9c9472d0309d053177debe9d8a82a5e1d91ecc8d66c1804b4def09ae23739e9c6#55f826fa447e0f5ea1d636f17eac77eafa573aa7701d4390145497e3321ed8a16#44#43#38#39#42#34a080fae90c732c3f847a17d81431504567aeed419c1aae0979fd2f9d693e7a6ef8e8daf84063d02dc0a47386746dc9a3118060689#35#30#32#31b3b3c624a395bd0529610c3c1dd007b0868053cb80958dc79464ff1542934a94cedd34082384bb761ce7a99e72a07fbce4f6828f0e3b3261bca5780ce14a0da7df56c248e5a4ea9a8f11299853ffae1082686f050e111ab9d2579c7dfe75f824ed657d2368888350e213b5d6d675af9a10fd55fd28abcd1c669b247b4716721105272df47ab6aef32ab9fde224cd4a50835f2d6ce7b138b9aaa31183407c01274f98ced08ff0c7e4317483e18b9b1dc034101ecdbc187985455516f786249f0f3abb4e4ff7ba5282d5d9f68441ad6b2d2a82da6caa93ec344d8ae26f6c25347278a20a3841a7c53dbf9496401f7495f8856c78813b5a392f3cad956fc9e67010c6b01acf816a3deb825d4ae3d3579a1f5cf20942ced246ed24fa777ce835609d1e1761bb45f21b9ca3c#18cddf0b8961f5b6cb84521f115d1d126994fa7c1ff3e36b03cf40dc3b6ce8ecf#197daf2096869e40efccd8801155c2f9c0c04f5ceeb86fce39818a788507c1c1212609748e25055b0718235f4d134afbcac3a5388d2fc5baa66c3b94f7e156944578422d5207e385db3411702597810bff854a3e97412734c2d7ce6edef5f261d156575a7e41dc7ac8b3a8cb98f126bf8aa05ec2f8b1dd276496559f81494aa8dac3384e6381d1be59ee716b8581b7a6f119cdfe1c9e929cece391ddde5cc5014004#869e96835c5c0d1ca6e895f488268b3a39a3e095c55825b7da0e1489ae5b6acd1bab2c7f87758e32bb7bfcd12c3b09e1f63a716ced8e3d262e1e25cf47235452fda1695c690497699f1bc71549c8b94f6de65ddb895298d67c5ee8fe20bd8e377b214837472863762eb5a5a1bd106fbfe3bc20061cac685b65cffe2a41c7d7d5282d29de64987d8762a715506ced44cc51c540277332529970d388930335#467a000798b2495be98389e88562a74b621c980ebc55247ce584c629c795aa0672202db64a64a45a727ae975e73274232f7a9b6c9abaa9caffe0d79b3721100fe32346d91a49a20e3573597122c615189f0bd0e429b77e0e02dd5be44c566fe0d5e27010065145895762531f66e68c32593e7be8325319603400a72ffb151742d74f8c0b06d68578ddc3b420c4da37bc12a6bb692f8c20449885715891b85b2a3a7039c803df730581a70029df0e2c980f722dde7d49c6e981dbdf85420cdd94a3bacbaddd632670e4bf27522d2ae97431348d36339aaf643c5c9aa01b7ffef09affab6c0070b45f87d6fc9cc7798ca0b0b707f058fb21631ac31335f70fb09d402e2deacf8dd15159694c1b3f9117af0b296060921f12eb9b25c0cf35c58cb5c1f2487b71cbc95a87ca4b7d288db761a6978323eff1f70218d20d7dfb52f366d47f257cedbc550819bbe33b497376353a323774b261a8988fd00fa0352ae82faa39a780687caf5a37bbbb99c94691b8633b10afc6274268cd85bdbddf8fd3972332c02bf36f45767bc2d73303a53fa06c5f6259b6fa87737e07f57c286ff360a6675f4ab92551d74326a628964acc96decd5940beb4e9994652aee709d9a6b04d597a13dc6446901d5ae297769de9fe3d5ab3b3eedbc48ab2cba479eb7853d9f3779aebae14bfa80afcd83a8a2e3fe27051841f7f1d4ef3cc1df8d307f485973ece19d484b1cac6fd27905d3fbccaa796724c166a69e246a7497654ad72c2faa01127057e09b3e0d19c8aca3cda1ab80711611b37ad7bd64f38081e3b34b4eb5c885b2a0cfa5431068cfd4eb38d8f710add9fc8db4ccfc59054f2d2b6d9913aa8cd8e0c79af9e6a8831850e748a618534f374d658c492bb704b2ef23421bb26c20d7e8494bba092a9127d8660f8ad8b9c53bd50b257ad60162b78b672c9aff7bd645d477677b5d6659473d95b896e73924aa1143c783a4e4d55f7c56ae0e00be21e84fb2007beca60af0b8a75569e96a94994772c23519882e0dc1a6d8014b3546cfa3e5971972dd93716166ea898a3b1e677738How can I help you explore Laravel packages today?