Check if xdebug is working

后端 未结 8 2120
暗喜
暗喜 2020-12-04 16:31

Without installing a texteditor or an IDE, is it possible to test if xdebug is working, i.e. if it can debug php code?

The only part xdebug comes up in phpinfo() is

8条回答
  •  鱼传尺愫
    2020-12-04 17:15

    If you are using Eclipse then please note that while running on XDebug mode the magic constant __FILE__ will always be evaluated to:

    xdebug://debug-eval
    

    So the following check will return true if your session is under XDebug:

    $is_xdebug = false !== strpos(__FILE__,'xdebug'); // true while on XDebug
    

提交回复
热议问题