1. Go to this page and download the library: Download dooaki/container library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dooaki / container example snippets
use dooaki\Container\Lazy\Enumerable;
class CountUp
{
use Enumerable;
public function each()
{
$i=0;
while(1) {
yield ++$i;
}
}
}
print_r((new CountUp())->take(3)->toArray());
// Array
// (
// [0] => 1
// [1] => 2
// [2] => 3
// )