-5

For my knowledge I will know what are the major difference between

$this->_data

and

$this->data

if they could show by example the approach. Thank you.

.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
yokogeri
  • 1,217
  • 2
  • 8
  • 11
  • 3
    No Difference other than you have one property called `data` and another called `_data` – RiggsFolly Nov 01 '17 at 00:08
  • 2
    There's no difference. A property starting with `_` is *sometimes* used to indicate that it's some sort of internal/temporary value you're not supposed to touch, but that's not a formal PHP thing at all. – ceejayoz Nov 01 '17 at 00:09
  • The difference here is '_' – YouneL Nov 01 '17 at 00:26

1 Answers1

0

There is no actual difference. It's just a common practice to prefix private properties with an underline for clarity inside the classes.

BaldurPan
  • 76
  • 1
  • 4