Re: Typed array properties V2
| From: | Rowan Tommins | Date: | Fri, 24 Jan 2020 20:52:52 +0000 |
| Subject: | Re: Typed array properties V2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108235@lists.php.net to get a copy of this message | ||
On 24/01/2020 19:27, Mike Schinkel wrote:
ALLOW the use of a syntax for typed arrays — whether it be type[] or [type] — but only validate that it is an array and that the "type" is in fact a type, but don't actually validate that each element is the correct type.I don't really see much point in that. Tools are happily reading this information from docblocks already, so all I can see this achieving is: 1) Misleading users into thinking the language will guarantee something when it won't. 2) Making it harder to use that syntax for a different purpose later, because code will be out there which lists such constraints but violates them, and will suddenly fail if the checks are enforced. Regards, -- Rowan Tommins (né Collins) [IMSoP]