# Class methods within classes

**URL:** <https://forum.kirupa.com/t/class-methods-within-classes/142748>\
**Category:** Uncategorized\
**Created:** [March 31, 2005, 6:44am UTC](https://forum.kirupa.com/t/class-methods-within-classes/142748 "2005-03-31T06:44:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahndi](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jahndi](https://forum.kirupa.com/u/jahndi)\
**Post date:** [March 31, 2005, 6:44am UTC](https://forum.kirupa.com/t/class-methods-within-classes/142748/1 "2005-03-31T06:44:01Z")

</div>

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
