M
M
Morfeey2018-06-13 15:59:14
PHP
Morfeey, 2018-06-13 15:59:14

Realization of a normal contest, is it possible?

A little typing has recently appeared in the language. This context is now available:

....
        public function GetFile (): File {}
        public function GetFiles (): array {}
 ....

Is a similar context possible?:
....
        public function GetFiles (): File[] {}
 ....

If not, then perhaps you know if they are going to do something like this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-06-13
@Morfeey

https://wiki.php.net/rfc/arrayof
rejected such a proposal a long time ago, there are code examples for solving this problem with the current syntax.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question