Re: [RFC] Union Types

From: Date: Sun, 17 Apr 2016 10:28:08 +0000
Subject: Re: [RFC] Union Types
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-92378@lists.php.net to get a copy of this message
I think it will be better if union type is only allowed in the "type" statement, like what you described in your RFC. type Iterable = Array <http://www.php.net/array> | Traversable; If we can always pre-define the types. And only allow just one type for each function parameter in the function prototype, then, I think the performance impact of type checking in the runtime might be able to be reduced. In other words, you predefine the union type before you used them, and the union types can be reused in different functions, you don't write a lot union type in function prototype.

« previous php.internals (#92378) next »