<?php
class cls{
public $data;
public $active;
function __construct(){
$this->data = '<li class="'.$this->active.'"></li>';
}
function test(){
$this->active = 'active';
return $this->active;
}
}
$cls = new cls;
echo $cls->data; // Why __construct() does not update ?