History log of /PHP-7.4/Zend/zend_generators.c (Results 226 – 241 of 241)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 12e92831 29-May-2012 Nikita Popov

Fix segfault when send()ing to a closed generator


# 3600914c 29-May-2012 Nikita Popov

Add support for $generator->send()

Yield now is an expression and the return value is the value passed to
$generator->send(). By default (i.e. if ->next() is called) the value is
NUL

Add support for $generator->send()

Yield now is an expression and the return value is the value passed to
$generator->send(). By default (i.e. if ->next() is called) the value is
NULL.

Unlike in Python ->send() can be run without priming the generator with a
->next() call first.

show more ...


# 4aab08b6 28-May-2012 Nikita Popov

Properly free resources when generator return value not used

To keep things clean two new functions are introduced:

zend_clean_and_cache_symbol_table(HashTable *symbol_table)
ze

Properly free resources when generator return value not used

To keep things clean two new functions are introduced:

zend_clean_and_cache_symbol_table(HashTable *symbol_table)
zend_free_compiled_variables(zval ***CVs, int num)

show more ...


# bcc7d976 27-May-2012 Nikita Popov

Set EG(current_execute_data)

This fixes several issues. In particular it makes method generators work
properly and also allows generators using a symbol table.


# 64a643a4 27-May-2012 Nikita Popov

Free loop variables

If the generator is closed before it has finished running, it may happen
that some FREE or SWITCH_FREE opcodes haven't been executed and memory is
leaked.

Free loop variables

If the generator is closed before it has finished running, it may happen
that some FREE or SWITCH_FREE opcodes haven't been executed and memory is
leaked.

This fixes it by walking the brk_cont_array and manually freeing the
variables.

show more ...


# 247bb737 27-May-2012 Nikita Popov

Add support for generator methods


# cbfa96ca 26-May-2012 Nikita Popov

Remove wrong dtor call


# d49d3971 26-May-2012 Nikita Popov

Close generator on return


# 5bb3a995 26-May-2012 Nikita Popov

Implement return for generators

For generators ZEND_RETURN directly calls ZEND_VM_RETURN(), thus passing
execution back to the caller (zend_generator_resume).

This commit also a

Implement return for generators

For generators ZEND_RETURN directly calls ZEND_VM_RETURN(), thus passing
execution back to the caller (zend_generator_resume).

This commit also adds a check that only return; is used in generators and
not return $value;.

show more ...


# fafce586 26-May-2012 Nikita Popov

Add YIELD opcode implementation


# 1a99d1c8 26-May-2012 Nikita Popov

Add way to pass generator object to opcode handlers

The generator zval is put into the return_value_ptr_ptr.


# f627be52 26-May-2012 Nikita Popov

Add support for executing a zend_execute_data

This adds another function execute_ex(), which accepts a zend_execute_data
struct to run (contrary to execute(), which accepts a zend_op_arr

Add support for executing a zend_execute_data

This adds another function execute_ex(), which accepts a zend_execute_data
struct to run (contrary to execute(), which accepts a zend_op_array from
which it initialized the execute_data).

This needs a bit more cleanup.

show more ...


# 2c5ecb4f 23-May-2012 Nikita Popov

Add dummy Iterator implementation

This simply adds dummy rewind/valid/current/key/next methods to Generator.


# 9ce9a7e6 23-May-2012 Nikita Popov

Add initial code for suspending execution

This is just some initial code, which is still quite broken (and needs to be
moved so it can be reused.)


# 40b75335 20-May-2012 Nikita Popov

Add some boilerplate code for Generator class

The Generator class now uses a zend_generator struct, so it'll be able to
store additional info.

This commit also ensures that Gene

Add some boilerplate code for Generator class

The Generator class now uses a zend_generator struct, so it'll be able to
store additional info.

This commit also ensures that Generator cannot be directly instantiated
and extended. The error tests are now in a separate folder from the
(yet-to-come) functional tests.

show more ...


# ca59e546 19-May-2012 Nikita Popov

Add empty Generator class


12345678910