View Issue Details

IDProjectCategoryView StatusLast Update
0002371XdebugStep Debuggingpublic2025-10-08 11:56
ReporterGromNaN Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version3.4.6 
Summary0002371: Step debugging initialize lazy objects
Description

When using step debugging with an uninitialized lazy object in the scope, the lazy objects are initialized.

Steps To Reproduce

Code sample:

<?php

class User
{
public int $id;
public string $name;
}

$reflection = new ReflectionClass(User::class);
$user = $reflection->newLazyGhost(function (User $user): void {
throw new \RuntimeException('Initialization should not be called');
});

var_dump($reflection->isUninitializedLazyObject($user));

When running this script, the output is "true".
But when a breakpoint is added on the var_dump line, the initialization closure is called.

Additional Information

Xdebug 3.4.6
PHP 8.4.8 (cli) (built: Jun 3 2025 16:29:26) (NTS)
PHPStorm 2025.2.2 Build #PS-252.26199.163, built on September 18, 2025

TagsNo tags attached.
Operating SystemMac OS 15.7.1 (24G231)
PHP Version8.4-dev

Relationships

has duplicate 0002359 assignedderick PHP 8.4 Lazy Ghost Object inoperable/defunct when Xdebug is enabled 

Activities

derick

2025-10-08 11:56

administrator   ~0007358

Thanks! Altough this is a duplicate, you've managed to produce a nice and short reproducible script that likely will make it very possible for me to track this down and hopefully fix.

Issue History

Date Modified Username Field Change
2025-10-08 09:56 GromNaN New Issue
2025-10-08 11:55 derick Relationship added has duplicate 0002359
2025-10-08 11:56 derick Note Added: 0007358