RE: [PHP-DEV] Introducing "Array Of" RFC

From: Date: Wed, 15 Jan 2014 19:24:35 +0000
Subject: RE: [PHP-DEV] Introducing "Array Of" RFC
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-71145@lists.php.net to get a copy of this message
Hey,

> -----Original Message-----
> From: Philip Sturgeon [mailto:pjsturgeon@gmail.com]
> Sent: Wednesday, January 15, 2014 7:18 PM
> To: internals@lists.php.net
> Subject: [PHP-DEV] Introducing "Array Of" RFC
> 
> 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.
> 
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php

First of all, I really like the RFC, good idea, well done.

But about some details. I am not sure if I got the implementation right (haven't done any code
contributions so far, so
I am not really familiar with the source code) but it seems that a check for NULL is implemented for
the actual
parameter which is perfectly fine (done for other type hints as well) but it also checks if all
members of an array are
not NULL and the check returns a failure if NULL is detected. I think that's wrong, NULL is a
perfect valid entry in an
array.

Furthermore, what about type hints like the following ones: 
function foo(int[] $qualities, callable[] $callables){}

Seems like they are not supported. But might be that I am totally wrong and did not understand the
code



Thread (46 messages)

« previous php.internals (#71145) next »