Request for RFC Karma: "use-from syntax for namespace use declarations"
| From: | Stuardo -StR- Rodríguez | Date: | Tue, 30 Dec 2025 16:25:24 +0000 |
| Subject: | Request for RFC Karma: "use-from syntax for namespace use declarations" | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-129724@lists.php.net to get a copy of this message | ||
Hello internals,
My name is Stuardo Rodríguez, and I would like to request RFC karma to
publish an RFC on the PHP wiki.
I am a professional PHP developer with over 15 years of experience building
web applications. You can find more about my background here:
- LinkedIn: https://www.linkedin.com/in/stuardo
I have prepared an RFC titled "use-from syntax for namespace use
declarations" which proposes an alternative
use syntax that improves
readability by placing imported symbols first, followed by a namespace
prefix introduced by from.
Example:
```php
use ClassA from Vendor\Package;
use {ClassB, ClassC as C} from Vendor\Package;
```
This is syntax sugar equivalent to existing imports:
```php
use Vendor\Package\ClassA;
use Vendor\Package\{ClassB, ClassC as C};
```
I have already implemented the necessary changes to the Zend Engine (lexer,
parser, tokenizer exposure) along with comprehensive test coverage. The
implementation:
- Introduces T_FROM token
- Supports single imports, grouped imports, and function/const imports
- Treats from as a soft keyword to preserve backward compatibility
(function from() remains valid)
- Includes 7 new test cases in Zend/tests/ plus tokenizer test
I would appreciate receiving wiki karma to create and publish this RFC for
community discussion. My wiki account username is: "str"\
Thank you for your consideration.
Best regards,
Stuardo Rodriguez
--
Stuardo Rodríguez Mercenary Web Developer La Maphpia
🌎 maphpia.com ✉ str@maphpia.com 📞 +502 3462-7169