I've been looking at some examples of yield
in PHP, trying to get a grasp of what situations one would use it in, and I began to notice that all of the examples I looked at had yield
within a for(...) {}
or foreach(...) {}
statement.
Is there a way to use yield
outside of a for
?