Gives an Error:
$this->model::byUserPermission()
Leads to: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)
Works:
$facade = $this->model;
$facade::byUserPermission()
Is this a PHP Bug? Or can someone explain this to my, why that is happening (I am using php 5.6 and i am new to php. From my point of view, both are exactly the same). Thanks
::has a higher precedence than->, in which case the code will be executed as$this->(model::byUserPermission()), which would be invalid, since calling a method on an undeclared constant doesn't make much sense. Can you try executing($this->model)::byUserPermission()? I'd think that would evaluate things in the right order.