Skip to content

The extension causes the PHP yield statement to result into an infinite loop #93

@tonix-tuft

Description

@tonix-tuft

I would like to report another issue: if I use the aop extension and I use a generator function (which yields), like the following (taken from the manual):

<?php
function gen_one_to_three() {
    for ($i = 1; $i <= 3; $i++) {
        // Note that $i is preserved between yields.
        yield $i;
    }
}

$generator = gen_one_to_three();
foreach ($generator as $value) {
    echo "$value\n";
}
?>

The following code will result in an infinite loop:

1 1 1 1 1 1 1 ... Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 448 bytes)

So I suppose it is a bug cause when I disable the extension, everything works fine:

1 2 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions