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 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.
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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Sat Jun 19 16:01:23 2021 UTC