This is a partial answer I found by trial an error (well more of a desperate scatter gun approach) interestingly ensuring there were NO xdebug v2.6 directives in php.ini made no difference to the VSCode error.
Failed loading C:\php\ext\php_xdebug-2.6.1-7.2-vc15-nts-x86_64.dll
I copied numerous examples of launch.json I found on the web making sure the port and path to php matched php.ini.
this launch.json version seemed to eliminate the misleading php7.2 error. (I have not got php7.2 anywhere) I am guessing that if the path to php.exe (which also needs to be set in settings.json is wrong VSCode has some fallback assumption about which PHP ver yoou are using
"type": "php",
"request": "launch",
"runtimeExecutable": "C:/pathtophpexe/php.exe",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003
}
After this I started getting a 'port' error Invalid "xdebug.client_port" setting. Invalid quantity "${port}": no valid leading digits
this latter problem was solved accidentally by replacing the php.ini line xdebug.client_host = 127.0.0.1
with
xdebug.client_host = localhost
the xdebug.log was saying it couldnt connect to the port and therefore wouldn't step through of course
anyway replacing 127.0.0.1 with localhost in php.ini has cured the problem.
So though the primary objective has been achieved viz - getting debug to work I am non the wiser about where the php7.2 error came from (it seems to have nothing to do with xdebug version 2.6 directives)
nor why specifying 127.0.0.1 does not work whereas localhost does.
if you can shed light and want to comment please read and understand the essence of the question 'why does VSCode report and error about PHP v7.2 and xdebug 2.6 when neither are installed?' and secondly 'why is specifying localhost successful when 127.0.0.1 is not?'
oh and tx PaulT that site you suggested was one I'd come across in my scatter gun approach of trying all kinds of examples of launch.json. Interestingly it says it is 'essential; to include the line xdebug.idekey=VSCODE
I have found that not to be the case (it doesnt matter whether its in php.ini or not but then Im only doing simple cli debugging - in any case the default is vsc and it can be found here
in VSCode under File > Preference > Settings > Extensions > PHP Debug > Ide Key.
I'm sorry that's not a complete explanation but it may help someone else cheers