debuggingphpstormphpstorm-2017.2

What do asterisks in properties' names mean in the debugger's view of PhpStorm?


I have an issue with my code and when I'm comparing the last working reversion with the current one, I see among other things this difference in the PhpStorm's debugging output:

working version

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

not working version

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

What is the difference between *MyType*myProperty and just myProperty in the debugging output of PhpStorm?


Solution

  • Just came here with the same question and found yours...

    After some investigation I believe those mark a class instance's private properties.

    Using a modified class from Symfony as an example:

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

    When debugging and looking at the properties of $this it'll contain the following:

    *Symfony\Component\EventDispatcher\EventDispatcher*sorted
    *Symfony\Component\EventDispatcher\EventDispatcher*listeners
    foo
    bar