Visual Studio、PHP、Xdebug:调试时评估代码时出错



我的Visual Studio调试器工作不正常错误评估代码";对于所有内容(请参阅变量值、1+1和任何其他PHP代码(。所有修复程序都不起作用。

我尝试过:

对比2017/2019/2022

PHP 7.4、PHP 8.0、PHP 8.1、PHP 8.2

我尝试了php.ini 的多种配置

我在W10上使用XAMPP 3.3.0。

当我尝试在即时窗口中运行任何PHP代码时,Xdebug日志显示如下错误:

[8796] [Step Debug] <- eval -i 16-0 -- ZXZhbCgidHJ5IHsgcmV0dXJuICAxICsgMTsgfWNhdGNoIChUaHJvd2FibGUgJHQpeyByZXR1cm4gbmV3IERldnNlbnNlRXZhbEVycm9yKCR0LT5nZXRNZXNzYWdlKCkpO31jYXRjaCAoRXhjZXB0aW9uICRlKXsgcmV0dXJuIG5ldyBEZXZzZW5zZUV2YWxFcnJvcigkZS0+Z2V0TWVzc2FnZSgpKTt9Iik7
[8796] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="16-0" status="break" reason="ok"><error code="206"><message><![CDATA[error evaluating code]]></message></error></response>

我正努力在一年前解决这个问题。没有成功。

该字符串的base64解码结果为:

eval("try { return  1 + 1; }catch (Throwable $t){ return new DevsenseEvalError($t->getMessage());}catch (Exception $e){ return new DevsenseEvalError($e->getMessage());}");

这不可能真正起作用,因为例如,您还没有在catch (Throwable $t)中转义$t,并且当您使用普通PHP:运行此程序时,会引发警告和解析错误

Warning: Undefined variable $t in /tmp/foo.php on line 2
Warning: Undefined variable $t in /tmp/foo.php on line 2
Warning: Attempt to read property "getMessage" on null in /tmp/foo.php on line 2
Warning: Undefined variable $e in /tmp/foo.php on line 2
Warning: Undefined variable $e in /tmp/foo.php on line 2
Warning: Attempt to read property "getMessage" on null in /tmp/foo.php on line 2
Parse error: syntax error, unexpected token ")" in /tmp/foo.php(2) : eval()'d code on line 1

Devsense(我不知道这是什么(似乎在给工作带来麻烦,因为它实际上应该发送MSsx(1+1的64进制编码形式(。

相关内容

最新更新