debugging in vscode

I am currently debugging a 10+ year old PHP project, trying to migrate it to PHP 7.2

While debugging VSCode would start giving me “error evaluating code” and jump out of the debug session after the first step.

When I stopped the debugger and reloaded the page, the page would load fine. So it didn’t seem like actual syntax or other code errors. Otherwise the page wouldn’t have come out correctly.

I put the error into DuckDuckGo and, magically, as if I was supposed to find that answer, this github issue popped up first: “error evaluating code” errors in debug console

Turns out, if you have an expression in your Watched expressions that VSCode cannot evaluate while debugging, it will break the debug process.

That is some weird-ass behaviour and I hope a bug entry exists so a fix can be found soon. This could literally take days to debug cause one would be looking for syntax or other errors.