On Sat, Apr 16, 2016 at 4:10 AM, Bastian Schneider <
bastian.schnei...@commerce-plus.com> wrote:

>
> Just a quick thought. I would prefer something like
>
>     union Iterable {
>         use array;
>         use ArrayAccess;
>         use Traversable;
>     }
>
>     function bla(Iterable $iterable) {
>         foreach($iterable as $element) {}
>     }
>
> Primitives like string, float, bool or int are not allowed in union. Only
> classes, interfaces and array. I doesn't see any benefit in combining
> string with int or int with float in one union.
>

Here's an example that shows combining scalar maybe useful:

union Numeric {
    use int;
    use float;
}

Something I would very much like to use where types are allowed.


>
> Do I overlook or missed anything?
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to