php - How to access a variable with random value inside a class? -
class session{ protected $git = md5(rand(1,6)); public function __construct($config = array()) { //// code $ses_id = $this->git; } public function _start_session() { //code again.. } }
here can't assign random value variable called git. how can if possible? random value need first time generated value till time converts null.
perform random inside constructor,
class session{ protected $git; public function __construct($config = array()) { //// code $this->git = md5(rand(1,6)); $ses_id = $this->git; } public function _start_session() { //code again.. } }
Comments
Post a Comment