i have the line of codes:
class foo{
public $object = new bar(2);
public function index(){
dd($this->object);
}
}
and the bar
object contains:
class bar{
protected $number;
function __construct($number){
$this->number = $number;
}
}
now its throwing me Constant expression contains invalid operation