What is the difference between them and this two examples:
function result($r){
for($i=0; $i<$r; $i++){
yield $i;
}
}
foreach(result(15) as $r){
echo $r;
};
And one with echo
only:
function result($r){
for($i=0; $i<$r; $i++){
echo $i;
}
}
result(15);
I am sure there is some but what is it? Couldn't answer myself after some googling, sorry.
No comments:
Post a Comment