|  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
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 23:01:29 2024 UTC