 Generator
package php Available on php
Generator is not a Haxe Iterable. It can be iterated one time only. Unfortunately Haxe does not know that in PHP generators may have no return expression or return value with any type of value. Use return null or untyped cast to workaround this issue: function generatorWithoutReturn():Generator {
	php.Syntax.yield(1);
	return null;
}

function generatorWithReturn():Generator {
	php.Syntax.yield(1);
	return cast "hello";
}

var g = generatorWithReturn();
for(i in g) {
	trace(i);
}
trace(g.getReturn()); // "hello"
See also:
http://php.net/manual/en/class.generator.php
Methods
current():Dynamic
getReturn():Dynamic
inlineiterator():GeneratorIterator
key():Dynamic
next():Void
rewind():Void
send(value:Dynamic):Dynamic
throwError(exception:Throwable):Dynamic
valid():Bool


    
{'path': 'public/docs/haxe~php/generator.html', 'source': 'DevDocs.IO'}