-
Notifications
You must be signed in to change notification settings - Fork 811
Open
Labels
Category: FibersbugDocumentation contains incorrect informationDocumentation contains incorrect informationenhancementNew feature or requestNew feature or request
Description
Description
Since version 8.2.0 when trying to create fiber in a function passed to pcntl_signal an "Cannot switch fibers in current execution context" error occurs.
The documentation says only about limitation in the destructor.
The following code:
<?php
pcntl_signal(SIGINT, function () {
$fiber = new Fiber(function () {
Fiber::suspend('test');
});
var_dump($fiber->start());
});
posix_kill(getmypid(), SIGINT);
pcntl_signal_dispatch();
Resulted in this output:
string(4) "test"
But I expected this output instead:
Uncaught FiberError: Cannot switch fibers in current execution context
PHP Version
PHP 8.2.0
Operating System
No response
Metadata
Metadata
Assignees
Labels
Category: FibersbugDocumentation contains incorrect informationDocumentation contains incorrect informationenhancementNew feature or requestNew feature or request