Req #80133 [NEW]: Allow reserved word 'list' to be used for namespaces (and classnames)

From: Date: Tue, 22 Sep 2020 14:55:58 +0000
Subject: Req #80133 [NEW]: Allow reserved word 'list' to be used for namespaces (and classnames)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229140@lists.php.net to get a copy of this message
From:             flexjoly at vfweb dot nl
Operating system: 
PHP version:      Next Minor Version
Package:          *General Issues
Bug Type:         Feature/Change Request
Bug description:Allow reserved word 'list' to be used for namespaces (and classnames)

Description:
------------
Hi,

That 'list' is a reserved word is understandable. But also very
annoying. For you need it a lot. Almost any crud has one or more lists.

I have (abstract base) classes like:
\data\data\Data
\data\data\DataInterface
\data\data\DataFactory

\data\record\Record
\data\record\RecordInterface
\data\record\RecordFactory

and I need:
\data\list\List (or \data\list\ListData)
\data\list\ListInterface
\data\list\ListFactory

But those are impossible.....
So instead of list we now use: listdata\ListData
Which is not consistent in our way of naming.

Now I wanted to make:
\import\list\ImportList

But even this is impossible. 


https://www.php.net/manual/en/reserved.keywords.php
Since 7.0 many "keywords are allowed as property, constant, and method
names".

It would be so nice if they would also be allowed as namespace. 

Greetz, flexjoly









-- 
Edit bug report at https://bugs.php.net/bug.php?id=80133&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80133&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80133&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80133&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80133&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80133&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80133&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80133&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80133&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80133&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80133&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80133&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80133&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80133&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80133&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80133&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80133&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80133&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#229140) next »