Re: Re: Generators in PHP
| From: | Stas Malyshev | Date: | Sun, 19 Aug 2012 04:28:14 +0000 |
| Subject: | Re: Re: Generators in PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62253@lists.php.net to get a copy of this message | ||
Hi!
> For PHP we would need to have some similar behavior. PHP's current
> exception model is incompatible with GeneratorExitException (because
> PHP does not have BaseExceptions). So what I'd probably do instead is
> monkeypatch a ZEND_RETURN opcode at the current execution position and
Patching opcodes is not a good idea, since opcodes could be cached, and
the cache can be shared between different processes.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227