php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #78518 Why still haven't short syntax / hinting for array/list/assoc/dict?
Submitted: 2019-09-09 10:34 UTC Modified: 2019-09-09 10:38 UTC
From: 6562680 at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 7.2.22 OS: Win10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: 6562680 at gmail dot com
New email:
PHP Version: OS:

 

 [2019-09-09 10:34 UTC] 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)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-09 10:38 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Arrays related +Package: Scripting Engine problem
 [2019-09-09 10:38 UTC] requinix@php.net
Yeah, programming is hard.
 [2019-09-09 10:54 UTC] 6562680 at gmail dot com
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`
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 05:01:38 2025 UTC