PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Is there any way to access the parent instance of an object?
E.g. in method $object->subobject->Method() I want to access $object->var. Is it possible with something like $parent? I know it doesn't exist but is there similar way to do so?
debug_backtrace() can tell you what class, and possibly a reference to the containing object from within the enclosed class' method.. but it should probably be given to the enclosed class in some fashion.. Although this is bad OOP behavior.