我如何在 PhpStorm 中查看函数的结果

How I see the result of a function in PhpStorm

我有 PHP 像这样的代码:

$q = $conn->prepare("select * from worker");
$q->execute();

$result = $q->fetchAll();
echo json_encode($result);

如何在 PhpStorm 中查看 $result 变量的 json 结果?

顺便说一句,我知道如何添加断点并停在我想要的行我只是不知道如何读取从 json_encode.

返回的值

打开菜单 -> 运行 -> 计算表达式(或按 Alt-F8)并添加 json_encode($result) 作为要计算的表达式。

或者使用屏幕截图中可见的绿色加号按钮将表达式添加到监视 window。

我刚刚添加了一个这样的手表

json_encode($result);