View Issue Details

IDProjectCategoryView StatusLast Update
0002371XdebugStep Debuggingpublic2025-10-26 13:36
ReporterGromNaN Assigned Toderick  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version3.4.6 
Fixed in Version3.4.7 
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 closedderick 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.

derick

2025-10-23 17:19

administrator   ~0007369

https://github.com/xdebug/xdebug/pull/1041

derick

2025-10-23 18:21

administrator   ~0007372

Should be fixed in GIT (both xdebug_3_4 and master branch) — can you please check?

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
2025-10-23 17:19 derick Note Added: 0007369
2025-10-23 18:21 derick Assigned To => derick
2025-10-23 18:21 derick Status new => closed
2025-10-23 18:21 derick Resolution open => fixed
2025-10-23 18:21 derick Fixed in Version => 3.4dev
2025-10-23 18:21 derick Note Added: 0007372
2025-10-26 13:36 derick Fixed in Version 3.4dev => 3.4.7