Req #69914 [Opn->Nab]: Not possible to specify array type as a return type
| From: | rasmus@php.net | Date: | Tue, 23 Jun 2015 19:09:40 +0000 |
| Subject: | Req #69914 [Opn->Nab]: Not possible to specify array type as a return type | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-805@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69914&edit=1
ID: 69914
Updated by: rasmus@php.net
Reported by: tim dot bezhashvyly at gmail dot com
Summary: Not possible to specify array type as a return type
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: PHP Language Specification
Operating System: Debian GNU/Linux 8
PHP Version: 7.0.0alpha1
Block user comment: N
Private report: N
New Comment:
There is no such thing as a typed array.
Previous Comments:
------------------------------------------------------------------------
[2015-06-23 19:04:51] tim dot bezhashvyly at gmail dot com
Description:
------------
Specifying specific array type as a return type of a method/function produces a syntax error.
Test script:
---------------
function foo(): string[]
{
return ['bar'];
}
Actual result:
--------------
Parse error: syntax error, unexpected '[', expecting ';' or '{' in ...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69914&edit=1