I need to write a simple script that loads data from multiple files and smooths them somehow. However, given the fact that the files can be quite huge, I would like to partially download the data. For this, I decided to use the output. And according to the examples I found, I could use the following construction for a single generator:
$generator = $someClass->load();
foreach($generator as $i) {
}
But what if I want to use two generators at once?
$generatorA = $someClass1->load();
$generatorB = $someClass2->load();
foreach($generatorA as $i) {
}
source
share