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:6
Avg. Score:4.7 ± 0.7
Reproduced:5 of 6 (83.3%)
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: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at marcgrabow dot de
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC