update : 2015.11.03
php.shukuma.com검색:
|
Generator::throw(PHP 5 >= 5.5.0) Generator::throw — Throw an exception into the generator 설명Throws an exception into the generator and resumes execution of the generator. The behavior will be the same as if the current yield expression was replaced with a throw $exception statement. If the generator is already closed when this method is invoked, the exception will be thrown in the caller's context instead. 인수
반환값Returns the yielded value. 예제
Example #1 Throwing an exception into a generator
<?php 위 예제의 출력: Foo Exception: Test Bar |