Last active
November 12, 2017 10:35
-
-
Save minedun6/c4b3dd673ee965139b5ee485ce54e2bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
if (!function_exists('times')) { | |
function times ($i, $callback) { | |
return collect(range(1, $i))->each($callback) | |
} | |
} | |
// Usage | |
times(10, function ($i) { echo $i; }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment