1

我的代码有问题,当我将最后一个工作恢复与当前版本进行比较时,除其他外,我看到 PhpStorm 的调试输出中存在这种差异:

工作版

object = {MyNamespace\DataObject\ProtocolSetForProtocolServer} [3]
 *MyNamespace\DataObject\ProtocolSet*id = null
 *MyNamespace\DataObject\ProtocolSet*endpoint = null
 *MyNamespace\DataObject\ProtocolSet*protocols = {Doctrine\Common\Collections\ArrayCollection} [1]

不工作版本

object = {MyNamespace\DataObject\ProtocolSetForProtocolServer} [3]
 id = null
 endpoint = null
 protocols = {Doctrine\Common\Collections\ArrayCollection} [1]

*MyType*myProperty和只是myProperty在 PhpStorm 的调试输出中有什么区别?

4

1 回答 1

2

刚刚带着同样的问题来到这里,找到了你的......

经过一番调查,我相信这些标记了类实例的私有属性。

以 Symfony 中的修改类为例:

namespace Symfony\Component\EventDispatcher;

class EventDispatcher implements EventDispatcherInterface
{
    private $listeners = array();
    private $sorted = array();
    public $foo = array();
    protected $bar = array();
}

在调试和查看它的属性时$this,将包含以下内容:

*Symfony\Component\EventDispatcher\EventDispatcher*sorted
*Symfony\Component\EventDispatcher\EventDispatcher*listeners
foo
bar
于 2017-09-11T10:32:50.023 回答