View Issue Details

IDProjectCategoryView StatusLast Update
0001309XdebugStep Debuggingpublic2020-03-12 16:51
Reporterniloct Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionduplicate 
PlatformMacOSEl CaptainOS Version10.11.5
Product Version2.4.0 
Summary0001309: Changing context with context_get and evaluating property in this new context gets null value
Description

Is eval only supposed to work with context stack depth = 0 ?

When I fetch a stack depth > 1, then try to eval a variable which exists in this stack depth context, null is returned.

Steps To Reproduce

Run the below code with a breakpoint set on the commented line, then issue a command "context-get -d 1" (change stack depth to 1), then "eval $A". The result is null instead of the array.

=========================8<======================

<?php

function B() {
$B = array();

for ($i = 0; $i < 10; $i++) {
    $B[$i] = 'B>>Item num: ' . ($i+1); /* Place bp here */
}

}

$A = array();

for ($i = 0; $i < 10; $i++) {
$A[$i] = 'Item num: ' . ($i+1);
}

B();

Additional Information

See attached xdebug.log

TagsNo tags attached.
Operating SystemMac OS X El Captain
PHP Version5.5.30-5.5.34

Relationships

duplicate of 0001342 acknowledgedderick Support -d parameter for eval 

Activities

niloct

2016-06-09 21:08

reporter   ~0003629

Sorry, stack depth > 0

derick

2016-06-10 10:14

administrator   ~0003631

The context_get does not change the internal reference of the current stack frame. It only gets information for that.

Right now, the eval command does not support other stack depths besides "0". The protocol (https://xdebug.org/docs-dbgp.php#eval) also doesn't allow this possibility.

derick

2016-12-11 23:26

administrator   ~0004001

This is a duplicate of 0001342: Add support for -d to eval.