Req #78518 [Com]: Why still haven't short syntax / hinting for array/list/assoc/dict?
| From: | 6562680 at gmail dot com | Date: | Mon, 09 Sep 2019 10:54:51 +0000 |
| Subject: | Req #78518 [Com]: Why still haven't short syntax / hinting for array/list/assoc/dict? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222655@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78518&edit=1
ID: 78518
Comment by: 6562680 at gmail dot com
Reported by: 6562680 at gmail dot com
Summary: Why still haven't short syntax / hinting for
array/list/assoc/dict?
Status: Not a bug
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: Win10
PHP Version: 7.2.22
Block user comment: N
Private report: N
New Comment:
W00t?
Is the problem to add typehints?
Python have dicts/cortages
Js has arrays/short_syntax_objects
Java has 'Class[]' return checkers / typehint
Php means - programming is hard 0_o ??
It is feature request.
Not a bug seems like Trashed
Previous Comments:
------------------------------------------------------------------------
[2019-09-09 10:38:16] requinix@php.net
Yeah, programming is hard.
------------------------------------------------------------------------
[2019-09-09 10:34:42] 6562680 at gmail dot com
Description:
------------
Usually we can get from user (from GET/POST parsers) anything.
Yes, usually we use validators.
But even validators have to know - what is it.
Is it an array? (usually building collections, iterate and so on -> that have numeric incremental
keys ordered by natsort without misses)
Is it an list? (usually PUT requests to batch upload by keys -> that have numeric non-incremental
keys non-ordered, can miss some keys)
Is it an assoc? (usually grouping with arguments unpacking - you can pass string, array, array of
strings, assoc where strings is key and value are bool -> that have at least one string key)
Is it an dict? (usually building an Entity object -> that have only string keys)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78518&edit=1