php.net |  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
Votes:1
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
Description:
------------
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 ] )


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-15 18:01 UTC] nikic@php.net
Seems unnecessary to me, especially as you can always do (new ReflectionObject($obj))->getShortName().
 [2012-11-19 03:24 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2012-11-19 03:24 UTC] aharvey@php.net
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-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 16:01:29 2025 UTC