View Issue Details

IDProjectCategoryView StatusLast Update
0001669XdebugUncategorizedpublic2019-06-28 11:48
Reportervee Assigned Toderick  
Status resolvedResolutionduplicate 
PlatformWindowsOSWindowsOS Version10
Product Version2.7.2 
Summary0001669: Cannot log anything if there is class destructor.

I have this code.


class SomeClass
    protected $name;

    public function __construct($name = null)
        if (!empty($name) && is_scalar($name)) {
            $this->name = $name;
        } else {
            $this->name = 'World';

    public function __destruct()
        $this->name = null;

    public function sayHello($name = null)
        if (!empty($name) && is_scalar($name)) {
            $this->name = $name;

        echo 'Hello ' . $this->name . '<br>' . PHP_EOL;



require 'SomeClass.php';

$SomeClass = new SomeClass();

$random = mt_rand(1, 999);


If I run this code on PHP since 5.5 to7.3 (32 bit) with the latest version of Xdebug, anything cannot be log and Webgrind or QCachegrind can only display SomeClass.php with __destruct() method.
The index.php file did not appears and mt_rand() function also did not appear.

Steps To Reproduce

Run the example source code above with PHP 5.5 or newer (7.3).
Open Xdebug log (cachegrind.out.xxxx.xxxxxxxx) with anything such as Webgrind, QCachegrind.
Can't see index.php file running. Nothing else but SomeClass.php with __destruct() method.

Additional Information

Xdebug 2.7.2
PHP 7.3.2 32 bit
Apache 2.4 32 bit
Windows 10 64 bit

Operating SystemWindows 10 64 bit
PHP Version7.3.2-7.3.4


duplicate of 0001655 resolvedderick 2 profile/cachegrind files created when auto_prepend_file in use 



2019-06-28 11:48

administrator   ~0005047


this is the same problem as from 0001655 (2 profile/cachegrind files created when auto_prepend_file in use), with the additional issue is that on Windows, Xdebug can't detect that a profile file is already opened for writing, and hence, it doesn't create two files, but instead overwrites one. You can work around the latter issue by setting xdebug.profiler_output_name to "cachegrind.out.%p.%r" (with the %r adding a random number to the default).

I will see whether I can address to root cause when I resolve issue 0001655.


Issue History

Date Modified Username Field Change
2019-05-21 09:28 vee New Issue
2019-05-21 09:28 vee Tag Attached: destructor
2019-06-28 11:48 derick Assigned To => derick
2019-06-28 11:48 derick Status new => resolved
2019-06-28 11:48 derick Resolution open => duplicate
2019-06-28 11:48 derick Note Added: 0005047
2019-06-28 11:48 derick Relationship added duplicate of 0001655
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized