|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-25 16:28 UTC] cmb@php.net
-Status: Open
+Status: Suspended
-Package: Feature/Change Request
+Package: *General Issues
[2018-03-25 16:28 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 16:00:01 2025 UTC |
Description: ------------ I suggest adding a new function called __import() or __use() or something similar to autoload namespaces when they are used() but undefined. Reproduce code: --------------- core.php <?php function __import($sNamespace) { // sample code to load namespace dynamically echo "Auto-Importing $sNamespace\n"; require_once '/path/to/folder/' . join('/', explode('::', $sNamespace) . '.php'; } ?> some_other_file.php <?php namespace MyNamespace; use Library::DB::Connector; use Library::Other::Stuff; ?> Expected result: ---------------- Auto-Importing Library::DB::Connector Auto-Importing Library::Other::Stuff