PHP, distinguish between internal and external class method call
问题 Can't get my head around this, is there any way to check if a method was called internally? By this I mean a traceback to check if it was called by $this and not a pointer to the instance. Kind of like the concept of private function but only function is public? <?php class Foo { public function check () { /* if invoked by $this (internally) return true else return false */ } public function callCheck () { /* returns true because its called by $this */ return $this->check(); } } $bar = new