Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Created March 11, 2015 12:01
Show Gist options
  • Save lorenzo/5de6cdf8dde9fb6d6b29 to your computer and use it in GitHub Desktop.
Save lorenzo/5de6cdf8dde9fb6d6b29 to your computer and use it in GitHub Desktop.
<?php
require 'vendor/autoload.php';
$connection = new PDO(getenv('MYSQL'));
$looper = function () use ($connection) {
foreach ([1, 2, 3] as $number) {
yield $connection->query('select * from categories');
}
};
$list = (new \Cake\Collection\Collection($looper()))->map(function($r) { return $r; });
iterator_to_array($list, false);
#!/bin/bash
composer require cakephp/collection=dev-master
php bug.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment