|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50552 Add function to get all used namespaces
Submitted: 2009-12-22 02:53 UTC Modified: 2021-12-05 04:22 UTC
Avg. Score:3.6 ± 1.8
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:2 (40.0%)
From: kristopherwilson at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: Scripting Engine problem
PHP Version: * OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-12-22 02:53 UTC] kristopherwilson at gmail dot com
Provide a function for returning all namespaces used in the current request to aid in autoloading. 

Reproduce code:
    use My\Namespace;
    use Other\Namespace;


Expected result:
    [0] = My\Namespace,
    [1] = Other\Namespace

Actual result:
No such function exists.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-24 09:50 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem -Operating System: Any +Operating System: * -PHP Version: 5.3.1 +PHP Version: *
 [2021-11-23 11:24 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-11-23 11:24 UTC]
Namespace imports are a compile time concept only; during runtime
PHP has no general notion of these, only of the fully qualified
names of individual classes, functions, etc.  As such,
implementing this feature would require quite some changes,
possibly having detrimental effects on the engine, and the details
are sufficiently unclear, so this would require the RFC

However, I wonder what would be the use-case at all.  How could
that be useful "to aid in autoloading"?

[1] <>
 [2021-12-05 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 11 17:01:30 2023 UTC