I know these ways of starting Xdebug:
?XDEBUG_SESSION_START=name in url
xdebug.remote_autostart=On in php.ini
-dxdebug.remote_autostart=On as parameter to the PHP binary call
but I do not know how to start xdebug inside code, is there any function like xdebug_start() and xdebug_stop() ?
In order to start the debugging somewhere else in your PHP code than at the start, you need to set
xdebug.remote_mode=jitinphp.ini. Then when you callxdebug_breakthe debugging session will start.