View Issue Details

IDProjectCategoryView StatusLast Update
0002249XdebugStacktracespublic2024-04-15 12:53
ReporterKingdutch Assigned Toderick  
Status newResolutionreopened 
PlatformPHPStormOSMacOS Version14.2.1 (23C71)
Product Version3.3.1 
Summary0002249: Debug callstack/stacktrace does not show origin of current Fiber

When setting a breakpoint inside of a Fiber (using PhpStorm 2023.3.3 because I'm unsure how else to use xdebug) the frames end at the Fiber boundary:

index.php:6, {closure:~/Projects/revolt-playground/index.php:5-8}()
index.php:11, {fiber:103897040}()

This does not show where the Fiber came from which can make debugging difficult. However I throw an exception (e.g. by executing (new \Exception())->getTrace() in the "Evaluate Expression" window; or by adding a line with throw). Then I get information about where the Fiber was started from which can be very informative (this is doFiber in the example code of the reproduction steps).

Is it possible for Xdebug to provide more information so that the callstack also shows similar information as an exception would in trace depth? Or is this information already available but does PHPStorm not show it correctly (I couldn't find an existing issue that might suggest Xdebug exposes this information)

Steps To Reproduce

For the following PHP code
<code php>

function doFiber() {
$fiber = new \Fiber(function (): void {
$value = \Fiber::suspend('fiber');
echo "Value used to resume fiber: ", $value, PHP_EOL;

$value = $fiber->start();

echo "Value from fiber suspending: ", $value, PHP_EOL;



Set a breakpoint on <code>$value = \Fiber::suspend('fiber');</code>

Additional Information

PHP 8.3.3 (cli) (built: Feb 13 2024 15:41:14) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies
with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans
with Zend OPcache v8.3.3, Copyright (c), by Zend Technologies

TagsStack Trace
Operating System
PHP Version8.2.0-8.2.9


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2024-03-10 16:45 Kingdutch New Issue
2024-03-10 16:45 Kingdutch Tag Attached: Stack Trace
2024-03-28 16:52 derick Assigned To => derick
2024-03-28 16:52 derick Status new => closed
2024-03-28 16:52 derick Resolution open => fixed
2024-03-28 16:52 derick Fixed in Version => 3.3dev
2024-03-28 16:53 derick Status closed => new
2024-03-28 16:53 derick Resolution fixed => reopened
2024-04-15 12:49 derick Fixed in Version 3.3dev => 3.3.2
2024-04-15 12:53 derick Fixed in Version 3.3.2 =>