On Wed, Jun 6, 2012 at 4:15 AM, Laruence <larue...@php.net> wrote: > Hi Nikita: > > the most important part to me is how did you implemented `yield` > keyword, is there a whole patch file I can look into? > > what will happen if you use a `yield` in a normal function? > > actually, I tried to implemented coroutine, but since I could not > find a way to make zend_execute interruptable, then I didn't make it. Yes I also faced that problem. The current execute() function accepts an op_array and initializes the execution context from that (execute_data + CVs + Ts).
So I added a new function execute_ex() which takes that execution context directly. The execute() function now works by initializing the execute_data using a new zend_create_execute_data_from_op_array() function and then calls execute_ex() with it. The most relevant commit for this change is https://github.com/nikic/php-src/commit/f627be52540738e124da7cb1566d7f60a2b6a48b. Nikita -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php