I have an included file in php that can be include from inside a class method or from global scope.
$this
will be valid in the first case but not the the second.
Is there a way to check if $this
is accessible?
isset($this)
and is_object($this)
seem to return true
even not being in a method of a class.