|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63526 get_class(): New parameter to allow stripping of namespace
Submitted: 2012-11-15 11:38 UTC Modified: 2012-11-19 03:24 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: alex at arcomit dot co dot uk Assigned:
Status: Wont fix Package: Class/Object related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: alex at arcomit dot co dot uk
New email:
PHP Version: OS:


 [2012-11-15 11:38 UTC] alex at arcomit dot co dot uk
Add a new parameter to get_class so it can return the class with the namespace removed.

string get_class ([ object $object = NULL ] , [ bool $stripNamespace = FALSE ] )


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-15 18:01 UTC]
Seems unnecessary to me, especially as you can always do (new ReflectionObject($obj))->getShortName().
 [2012-11-19 03:24 UTC]
-Status: Open +Status: Wont fix
 [2012-11-19 03:24 UTC]
Agreed: reflection or simple string manipulation can handle this case, and most of the time you need the fully qualified name anyway. Closing Won't Fix.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 24 04:03:39 2023 UTC