View Issue Details

IDProjectCategoryView StatusLast Update
0002166XdebugStep Debuggingpublic2023-03-11 20:18
Reportermannycrafts Assigned To 
PrioritynoneSeverityminorReproducibilityrandom
Status newResolutionopen 
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
Operating System
PHP Version8.0.20-8.0.29

Activities

mannycrafts

2023-03-11 20:18

reporter  

xdebug-int-or-null-gettype.jpg (62,666 bytes)   
xdebug-int-or-null-gettype.jpg (62,666 bytes)   

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