install xdebug windows and configure it to visual studio code code example
Example: visual code debug php
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1