Pike v8.1 release 6

Method this_object()


Method this_object

object this_object(void|int level)

Description

Returns the object we are currently evaluating in.

Parameter level

level may be used to access the object of a surrounding class: The object at level 0 is the current object, the object at level 1 is the one belonging to the class that surrounds the class that the object comes from, and so on.

Note

As opposed to a qualified this reference such as global::this, this function doesn't always access the objects belonging to the lexically surrounding classes. If the class containing the call has been inherited then the objects surrounding the inheriting class are accessed.