Class methods within classes

I have a question. How do you refer to class methods from within the methods of another class? Let’s say I have an object $error (of the “error” class) who’s methods I want to access from within a method in “class”. I know I can’t just use $error->method() from within the other class. Do I have to make the other class extend the “error” class or is there another way to access $error’s methods? Is this clear? Thanks!

John