View Issue Details

IDProjectCategoryView StatusLast Update
0002114XdebugStep Debuggingpublic2022-09-02 07:42
Reportermaxim.kolmakov Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status confirmedResolutionopen 
Product Version3.2.0alpha3 
Summary0002114: Local variables are not shown on Return Value debug step
Description

How to reproduce:

  1. Create the following code:
    
    <?php
    namespace K;
    use Exception;

function myMethod($b)
{
echo "$b";
$f = new \stdClass();
$f->xx = [$b, new Exception()];
return $f; //place breakpoint here
}

$foo = 1;
$a = myMethod(42); //place breakpoint here


2. Start debugger
On the first breakpoint hit, the local variable `$foo` will be shown in Watches.
3. Press _Resume Program_, 
4. On breakpoint, press _Step Into_

There will be no local variable `$foo`.
TagsNo tags attached.
Operating System
PHP Version8.0.10-8.0.19

Activities

derick

2022-09-02 07:41

administrator   ~0006370

This is currently expected. In the inter-frame between return and the assignment of the return value, the function's stack and the variables that belong here have already been destroyed. I'm leaving this open to see if I can do something about it, but I can't guarantee that it is even possible.

Issue History

Date Modified Username Field Change
2022-09-01 15:21 maxim.kolmakov New Issue
2022-09-02 07:41 derick Note Added: 0006370
2022-09-02 07:42 derick Severity minor => feature
2022-09-02 07:42 derick Status new => confirmed