View Issue Details

IDProjectCategoryView StatusLast Update
0002166XdebugStep Debuggingpublic2023-05-24 16:09
Reportermannycrafts Assigned Toderick  
PrioritynoneSeverityminorReproducibilityrandom
Status resolvedResolutionunable to reproduce 
Product Version3.1.5 
Summary0002166: Gettype type doesn't match during step debug
Description

While step debugging using VSCode, I found some unexpected behavior, and have no idea if Xdebug has anything do wtih this issue,

I'm running a cli script that loads WordPress before running.
At the point of execution in question, I expect a particular value( 1 ) to be stored in array location( $the_['accepted_args'] ).

The debugger reports the value as 1 (with no quotes) as expected, but it evaluates to 0/NULL at the same time.

  • $the_['accepted_args'] is reported to be 1
  • gettype($the_['accepted_args']) produces NULL
  • (int) $the_['accepted_args'] produces 0.

For some context, all the checks are performed while execution is paused on in WordPress apply_filters function.
It happens on in class-wp-hook.php#L310
https://github.com/WordPress/WordPress/blob/dc079079c007b852e7373c78e5da3fae4e28513d/wp-includes/class-wp-hook.php#L310

Thanks for any suggestions!

Steps To Reproduce

Couldn't reproduce on another machine..

THe issue happened after loading WordPress and then running the blow code block.

function mc_test($one){
return $one;
}
add_filter('mc_test', 'mc_test', 10, 1);
$maybe_single_param = apply_filters('mc_test', 'single-param');

Additional Information

Mac M1,, Xdebug running on Homestead Vagrant Box on a Mac M1

Tagscli, vscode
Attached Files
xdebug-int-or-null-gettype.jpg (62,666 bytes)   
xdebug-int-or-null-gettype.jpg (62,666 bytes)   
Operating System
PHP Version8.0.20-8.0.29

Activities

derick

2023-04-05 16:05

administrator   ~0006550

Can you reproduce this with a small example? I'm afraid there is nothing in this report that is actionable for me. Please read https://xdebug.org/reporting-bugs as to what sort of information I would require to diagnose and address a potential issue.

mannycrafts

2023-04-07 01:49

reporter   ~0006553

This bug is not easy for me to replicate, seems very specific to an environment I don't use anymore.
I had hope this would be something like mysqli issue 0001053 , with other people seeing unexpected behavior, but am also fine to be the only one this time. ;)
Thanks for your help!

derick

2023-05-24 16:09

administrator   ~0006563

Thanks for getting back to me. I'll close this then for now.

Issue History

Date Modified Username Field Change
2023-03-11 20:18 mannycrafts New Issue
2023-03-11 20:18 mannycrafts Tag Attached: cli
2023-03-11 20:18 mannycrafts Tag Attached: vscode
2023-03-11 20:18 mannycrafts File Added: xdebug-int-or-null-gettype.jpg
2023-04-05 16:05 derick Assigned To => derick
2023-04-05 16:05 derick Status new => feedback
2023-04-05 16:05 derick Note Added: 0006550
2023-04-07 01:49 mannycrafts Note Added: 0006553
2023-04-07 01:49 mannycrafts Status feedback => assigned
2023-05-24 16:09 derick Status assigned => resolved
2023-05-24 16:09 derick Resolution open => unable to reproduce
2023-05-24 16:09 derick Note Added: 0006563