View Issue Details

IDProjectCategoryView StatusLast Update
0002376XdebugUncategorizedpublic2025-10-26 13:54
ReporterHypeMC Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0002376: Variables not shown when lazy objects are used
Description

Product version is 3.4.7-dev, but it's not in the select menu.

When using PHP's lazy objects, the variable list in the PHPStorm debugger occasionally appears empty.
This happens before the lazy object is initialized.

Here's a simple example:

class Example
{
    public function __construct(public int $prop)
    {
        echo __METHOD__, "\n";
    }
}

(function () {
    $reflector = new ReflectionClass(Example::class);

    $lazyObject = $reflector->newLazyGhost(function (Example $object) {
        // Initialize object in-place
        $object->__construct(1);
    });

    var_dump($lazyObject);

    var_dump($lazyObject->prop);
})();
Steps To Reproduce
  1. Set a breakpoint before the lazy object is initialized (e.g. at the first var_dump() call).
  2. Start debugging.
  3. Observe that the variable list in PHPStorm is empty (see image 1).
  4. Continue execution until the object is initialized.
  5. After initialization, both $reflector and $lazyObject appear correctly in the debugger (see image 2).
TagsNo tags attached.
Attached Files
image_1.png (56,014 bytes)   
image_1.png (56,014 bytes)   
image_2.png (61,579 bytes)   
image_2.png (61,579 bytes)   
Operating SystemUbuntu 22.04
PHP Version8.4.10-8.4.19

Activities

Issue History

Date Modified Username Field Change
2025-10-26 13:54 HypeMC New Issue
2025-10-26 13:54 HypeMC File Added: image_1.png
2025-10-26 13:54 HypeMC File Added: image_2.png