php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37684 read class name of a inherited class with a inherited static method possible?
Submitted: 2006-06-02 20:24 UTC Modified: 2006-06-02 20:36 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:2 (40.0%)
From: info at marcgrabow dot de Assigned:
Status: Wont fix Package: Class/Object related
PHP Version: 5CVS-2006-06-02 (snap) OS: Win 2000
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-06-02 20:24 UTC] info at marcgrabow dot de
Description:
------------
I want to extract the class name of a inherited class with a inherited static method.

I've tried that in a lot of ways, but I didn't get it.

Is it possible at all?

Reproduce code:
---------------
class TestParent {
  static function getClass() {
    return get_class();
  }
}

class TestChild extends TestParent {
}

echo TestChild::getClass();

Expected result:
----------------
TestChild

Actual result:
--------------
TestParent

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-02 20:36 UTC] tony2001@php.net
You have to wait until we implement late static binding.
But personally I think your code works exactly the way it should work.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 19:01:53 2014 UTC