i would like to know. is php class variable store data for access anywhere in class without performing again.
suppose that
class myclass
{
public $date;
public function __construct(){
$this->date = date('Ymd');
}
}
$myclass = new myclass();
$myclass->date;
so as above code if i am using $myclass->date;
three time in my code. it means date()
function runs three time ? or just run one time and store current date in class variable and not utilize CPU power three time in same task?