# Getting the name of a static method's class

**URL:** <https://forum.kirupa.com/t/getting-the-name-of-a-static-methods-class/277248>\
**Category:** Uncategorized\
**Created:** [December 9, 2008, 10:29pm UTC](https://forum.kirupa.com/t/getting-the-name-of-a-static-methods-class/277248 "2008-12-09T22:29:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sammo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sammo/32/779_2.png) [@Sammo](https://forum.kirupa.com/u/Sammo)\
**Post date:** [December 9, 2008, 10:29pm UTC](https://forum.kirupa.com/t/getting-the-name-of-a-static-methods-class/277248/1 "2008-12-09T22:29:16Z")

</div>

```php
class One {
   static function test() {
      echo get_class(new self());
   }
}

One::test();
// produces: "One"

// However:
class Two extends One{}
Two::test();
// this also produces "One", any way to fix this?

```
