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

From: Date: Wed, 30 Sep 2020 13:39:33 +0000
Subject: Req #80133 [Csd]: Allow reserved word 'list' to be used for namespaces (and classnames)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229285@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80133&edit=1 ID: 80133 User updated by: flexjoly at vfweb dot nl Reported by: flexjoly at vfweb dot nl -Summary: Please add late-defining for class constants +Summary: Allow reserved word 'list' to be used for namespaces (and classnames) Status: Closed Type: Feature/Change Request -Package: *General Issues +Package: Class/Object related PHP Version: Irrelevant Assigned To: cmb Block user comment: N Private report: N New Comment: Title and package were wrongly changed Previous Comments: ------------------------------------------------------------------------ [2020-09-25 12:48:48] flexjoly at vfweb dot nl That is great news! Thanks! ------------------------------------------------------------------------ [2020-09-22 15:04:24] cmb@php.net You can use list as part of a namespace name as of PHP 8.0.0[1]. Using the keyword as standalone classname can't be supported, though. [1] <https://3v4l.org/hkth0> ------------------------------------------------------------------------ [2020-09-22 14:55:58] flexjoly at vfweb dot nl 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 this bug report at https://bugs.php.net/bug.php?id=80133&edit=1

« previous php.bugs (#229285) next »