update : 2015.11.03
php.shukuma.com검색:
|
Generator::send(PHP 5 >= 5.5.0) Generator::send — Send a value to the generator 설명Sends the given value to the generator as the result of the current yield expression and resumes execution of the generator. If the generator is not at a yield expression when this method is called, it will first be let to advance to the first yield expression before sending the value. As such it is not necessary to "prime" PHP generators with a Generator::next() call (like it is done in Python). 인수
반환값Returns the yielded value. 예제
Example #1 Using Generator::send() to inject values
<?php 위 예제의 출력: Hello world! Bye world! |