Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

This is only part of a thread. view whole thread
February 4, 2020 18:51 (Guilliam Xavier)
On Tue, Feb 4, 2020 at 1:48 PM Aimeos | Norbert Sendetzky
<> wrote:
> > [...] > > interface Arrayable extends ArrayAccess, Countable, Traversable > { > public function toArray() : array; > } > > [...] > > If union data types are available and "iterable" is implemented as > alias, an alias "arrayable" for "array|Arrayable" may be added as well.
About that last point: it would not be possible to have both the `Arrayable` interface and the `arrayable` reserved word because PHP is case-insensitive for those things (the same way you cannot declare an `interface Iterable` because of the `iterable` reserved word, <>), so you would need another name (if you want the alias) -- Guilliam Xavier