I have saw too many php class example use the code like this:
<?php
class Test
{
public $_default = array(
'page' => 1,
'perPage' => 10
);
public function __construct()
{
$curPage = $this->default['page'];
$perPage = $this->default['perPage'];
}
}
Why can $_default
be used via $this->default
instead of $this->_default
?
And which one is recommended?
P.S. If this question is duplicate, please tell me and I will delete it as soon as possible.