Re: [RFC] [DISCUSSION] Scalar Pseudo-type
| From: | Sara Golemon | Date: | Tue, 26 Dec 2017 19:15:26 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Scalar Pseudo-type | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101426@lists.php.net to get a copy of this message | ||
On Tue, Dec 26, 2017 at 10:56 AM, Sebastian Bergmann <sebastian@php.net> wrote:
> Am 26.12.2017 um 16:46 schrieb lists@rhsoft.net:
>> would you mind to explain this?
>
> "Foo|Bar", "array|string", etc. (still) make no sense to me.
>
> "scalar" makes sense to me although it is but an alias for
> "bool|float|int|string".
>
Would you feel differently if we combined union types with type aliasing?
use Numeric = int | float;
function foo(Numeric $bar) { ... }
-Sara