S
S
sorry_i_noob2019-01-13 22:17:44
xdebug
sorry_i_noob, 2019-01-13 22:17:44

Can I somehow find out during debugging which field is public, which is private, which is protected?

Hello. There is this code:

class A {
  public $public_field = 1;
  protected $protected_field = 2;
  private $private_field = 3;
}

$a = new A();
$stop = 1;

I put a breakpoint on the line
$stop = 1;
AND in my IDE (I have PhpStorm) I see the fields of the $a object:
5c3b8ea379322276666502.png
Can I somehow know which one is public, which one is private, which one is protected?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question