(I'm not sure if you have an error in your pasted code, since include_once
is a commonly used built-in function, but I suppose it could also be an instance function on an object...)
There's no reason why any one line of code can't reference $this
twice, or as many times as it needs to. $this
is just a reference to an object. So in this line of code:
$this->include_once($this->local_path.'/classes/ResponsiveHomeFeaturedClass.php');
It's just calling the include_once
function and passing it a value, which includes the local_path
value. This would accomplish the same thing:
$some_local_path = $this->local_path;
$this->include_once($some_local_path.'/classes/ResponsiveHomeFeaturedClass.php');
But it would be using an unnecessary temporary variable. include_once
is just a function, and local_path
is just a value. The latter can be used as a parameter for the former.