View Issue Details

IDProjectCategoryView StatusLast Update
0001645XdebugRemote Debuggingpublic2019-03-05 14:23
Reporterdv-dsAssigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2.7.0RC2 
Target VersionFixed in Version 
Summary0001645: Variable not set / present in locals when hitting deprecation warning
DescriptionAs each() is deprecated in 7.2+, the following code generates a deprecation warning.

This may or may not be the cause of the issue here, which is that evaluating the function argument is not possible without using the console. Function locals seem to be affected in the same way.

When this happens, assuming the debugger is made to stop as soon as this deprecation warning is generated, it is not possible to evaluate $arg in a normal way:
- At the top stack frame, the variable is not listed as a local. It can be evaluated properly in the console however.
- At the stack frame just below that, the variable is listed as a local, but it is shown to be "uninitialized". It can be evaluated properly in the console however.
Steps To Reproduce<?php

$x = [1, 2, 3];

function foobar($arg) {
    while (list($key, $value) = each($arg)) {
        echo "$key : $value\n";
    }
}

foobar($x);

// Set IDE to break on "everything", so that the deprecation warning is caught.
Additional InformationSetup:
- Visual Studio Code, 1.31.1
- Apache 2.4.37 (Homebrew)
- PHP 7.3.1 (Homebrew). Opcache disabled.
TagsNo tags attached.
Operating SystemmacOS
PHP Version7.3.0-7.3.1

Activities

derick

2019-03-05 13:30

administrator   ~0004936

As I can't run VS Code locally, would you mind attaching a remote debugging log as you did in 0001644?

dv-ds

2019-03-05 14:20

reporter   ~0004937

Sure thing, here you go.

xdebug_0001625.log (7,253 bytes)

dv-ds

2019-03-05 14:23

reporter   ~0004938

Oops, wrong log, sorry. Here goes.

xdebug-0001645.log (17,532 bytes)

Issue History

Date Modified Username Field Change
2019-03-05 12:54 dv-ds New Issue
2019-03-05 13:30 derick Assigned To => derick
2019-03-05 13:30 derick Status new => feedback
2019-03-05 13:30 derick Note Added: 0004936
2019-03-05 14:20 dv-ds File Added: xdebug_0001625.log
2019-03-05 14:20 dv-ds Note Added: 0004937
2019-03-05 14:20 dv-ds Status feedback => assigned
2019-03-05 14:23 dv-ds File Added: xdebug-0001645.log
2019-03-05 14:23 dv-ds Note Added: 0004938