Re: Introducing "Array Of" RFC

From: Date: Wed, 15 Jan 2014 20:07:11 +0000
Subject: Re: Introducing "Array Of" RFC
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Wed, Jan 15, 2014 at 8:49 PM, Lazare Inepologlou <[email protected]>wrote:

> 2014/1/15 Philip Sturgeon <[email protected]>
>
> > Hey,
> >
> > This is my first RFC so give me a little leeway if I get things wrong.
> >
> > https://wiki.php.net/rfc/arrayof
> >
> > The implementation has been written by Joe Watkins, and I will be
> > handling the RFC process for him.
> >
> > It is aimed at PHP 5.6, and so far the release managers seem to be ok
> > with the idea of this potentially being merged after the alpha
> > release, so this should not be considered an issue.
> >
> > Everything is open for discussion, especially the current error
> > messages. They are not perfect, so let us know if you have better
> > ideas.
> >
> >
> Hello,
>
> this is a nice proposal.
>
> I hope that it is not limited to arrays only... All tranversables should be
> acceptable (as they are acceptable for variadiac functions). Otherwise this
> will lead to unnecessary (and costly) convertions.
>

An array is not just traversable - it is also array accessible and
countable, as well as passable-to-array-functions. Allowing to pass
Traversables to an array typehint violates the type constraint.

Nikita


Thread (46 messages)

« previous php.internals (#71150) next »