Req #75935 [Opn->Csd]: Allow usage of multiple type hints
| From: | peehaa@php.net | Date: | Thu, 08 Feb 2018 10:24:06 +0000 |
| Subject: | Req #75935 [Opn->Csd]: Allow usage of multiple type hints | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213863@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75935&edit=1
ID: 75935
Updated by: peehaa@php.net
Reported by: francois5537 at gmail dot com
Summary: Allow usage of multiple type hints
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: *Programming Data Structures
Operating System: Linux
PHP Version: 7.2.2
-Assigned To:
+Assigned To: peehaa
Block user comment: N
Private report: N
New Comment:
This has already been proposed:
https://wiki.php.net/rfc/union_types
It may be revisited again later.
Previous Comments:
------------------------------------------------------------------------
[2018-02-08 10:21:16] francois5537 at gmail dot com
Description:
------------
I don't know if this already has been reported or already supported, sorry if this is the case.
Test script:
---------------
<?php
function canBeArrayOrString(string|array $route) {
// Don't allow object, int, etc.!
}
Expected result:
----------------
Something like 'Must be string, array - object given!'
Actual result:
--------------
Valid when array or string has been given.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75935&edit=1