|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
42 - 13 = ?
Subscribe to this entry?

 [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 16:05:49 2023 UTC