The Wayback Machine - https://web.archive.org/web/20201130094027/https://github.com/AOP-PHP/AOP/issues/93
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tonix-tuft opened this issue Mar 29, 2015 · 4 comments

Comments

@tonix-tuft
Copy link

@tonix-tuft tonix-tuft commented Mar 29, 2015

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

@goghcrow
Copy link

@goghcrow goghcrow commented Oct 9, 2015

only for debug~

@tonix-tuft
Copy link
Author

@tonix-tuft tonix-tuft commented Oct 9, 2015

What do you mean?
On Oct 9, 2015 7:18 AM, "xiaofeng" [email protected] wrote:

only for debug~


Reply to this email directly or view it on GitHub.

@goghcrow
Copy link

@goghcrow goghcrow commented Oct 13, 2015

I think this extension only should be used for debug~

@tonix-tuft
Copy link
Author

@tonix-tuft tonix-tuft commented Oct 14, 2015

Ok I understood now :)

2015-10-13 13:52 GMT+02:00 xiaofeng [email protected]:

I think this extension only should be used for debug~


Reply to this email directly or view it on GitHub
#93 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.