|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #75935 Allow usage of multiple type hints
Submitted: 2018-02-08 10:21 UTC Modified: 2018-02-08 10:24 UTC
From: francois5537 at gmail dot com Assigned: peehaa (profile)
Status: Closed Package: *Programming Data Structures
PHP Version: 7.2.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: francois5537 at gmail dot com
New email:
PHP Version: OS:


 [2018-02-08 10:21 UTC] francois5537 at gmail dot com
I don't know if this already has been reported or already supported, sorry if this is the case.

Test script:
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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-08 10:24 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: peehaa
 [2018-02-08 10:24 UTC]
This has already been proposed:

It may be revisited again later.
 [2018-02-08 10:26 UTC]
Also see the related discussion here:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 19:01:27 2023 UTC