Req #62734 [Opn->Dup]: [Feature Request]Multiple typehint support
Edit report at https://bugs.php.net/bug.php?id=62734&edit=1
ID: 62734
Updated by: aharvey@php.net
Reported by: k at webnfo dot com
Summary: [Feature Request]Multiple typehint support
-Status: Open
+Status: Duplicate
Type: Feature/Change Request
Package: *General Issues
PHP Version: 5.4.5
Block user comment: N
Private report: N
New Comment:
Previously requested as request #31785. I don't think anything's changed, really: the
stock advice of using an interface that defines the API you expect to be implemented stands, and I
don't think the object-or-array case is important enough to merit this sort of change.
Previous Comments:
------------------------------------------------------------------------
[2012-08-03 04:04:44] k at webnfo dot com
Description:
------------
With Multiple typehint support, function arguments can accept multiple specific type of data.
The syntax would be like this:
function demo(TypeA|ClassA|Array $var){
}
Which will accept the one of those types: TypeA, ClassA, Array as valid argument.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62734&edit=1
Thread (2 messages)