Skip to content

Evaluate namespaces in debug console #951

Open
@jeffam

Description

@jeffam

PHP version: 8.2.15
Xdebug version: 3.2.0
VS Code extension version: 1.34.0

When I test expressions in the debug console, I've noticed that namespaced classes don't seem to evaluate use statements.

For example, if I debug this code:

<?php

require '../vendor/autoload.php';

use XdebugNsTest\Bar;

$test = new Bar('Hello, World!');

var_dump($test instanceof Bar);

And enter the following in the debug console:

→  $test
 ❯ XdebugNsTest\Bar
→  $test instanceof Bar
   false
→  $test instanceof XdebugNsTest\Bar
   true

$test instanceof Bar returns false when I would expect it to return true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions