Created
June 11, 2022 06:41
-
-
Save drupol/d8aa080f70799c10156c459dc302c567 to your computer and use it in GitHub Desktop.
Bug in loophp/collection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* For the full copyright and license information, please view | |
* the LICENSE file that was distributed with this source code. | |
*/ | |
declare(strict_types=1); | |
include __DIR__ . '/vendor/autoload.php'; | |
use loophp\collection\Collection; | |
$integers = static function (): array { | |
$random = [random_int(0, 9)]; | |
return $random; | |
}; | |
$c = Collection::unfold($integers) | |
->unwrap() | |
->distinct(); | |
foreach ($c as $i) { | |
dump($i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment