# [VOTE][RFC] Array Of

- Thread: https://externals.io/message/72864
- Original archive: https://news-web.php.net/php.internals/72864
- Started by Philip Sturgeon on 2014-02-28T16:32:24+00:00
- Messages: 13
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #72864 — Philip Sturgeon — 2014-02-28T16:32:24+00:00

URL: https://externals.io/message/72864#72864

Hi internals!

I opened the vote on the array of RFC:

     https://wiki.php.net/rfc/arrayof#vote

Voting will end 2014/03/07

Phil

---

## #72865 — Kevin Ingwersen — 2014-02-28T16:46:40+00:00

URL: https://externals.io/message/72864#72865 · In reply to: #72864

Dumb question, but how do I actually vote o.o;?
Am Fr. Feb. 28 2014 17:32:24 schrieb Philip Sturgeon:

> Hi internals!
> 
> I opened the vote on the array of RFC:
> 
>     https://wiki.php.net/rfc/arrayof#vote
> 
> Voting will end 2014/03/07
> 
> Phil

---

## #72870 — Bob Weinand — 2014-02-28T17:30:48+00:00

URL: https://externals.io/message/72864#72870 · In reply to: #72864

Am 28.2.2014 um 17:32 schrieb Philip Sturgeon <pjsturgeon@gmail.com>:
> Hi internals!
> 
> I opened the vote on the array of RFC:
> 
>     https://wiki.php.net/rfc/arrayof#vote
> 
> Voting will end 2014/03/07
> 
> Phil
> 
> -- 
> 
> 


Hey Philip,

I voted no now.

a) This is something for PHP6 I feel (at least if the other RFCs were rejected for similar reasons)
b) We are so close to beta 5.6 now, I think we should stop introducing bigger features which affect the language etc. now
c) I'm not really sure if we want that feature… but that's another story...

My main problems are a) and b), so I voted no…

Bob

---

## #72871 — Andrea Faulds — 2014-02-28T17:45:20+00:00

URL: https://externals.io/message/72864#72871 · In reply to: #72870

> I voted no now.
> 
> a) This is something for PHP6 I feel (at least if the other RFCs were rejected for similar reasons)
> b) We are so close to beta 5.6 now, I think we should stop introducing bigger features which affect the language etc. now
> c) I'm not really sure if we want that feature… but that's another story...


I also voted against. I don’t like the [] syntax and PHP 5.6 is too close.

I will also say again that I don’t think the generics/arrayof vote was fair. It had no option representing my position: “Use generics-like syntax, I don’t care whether we add generics later or not”.

--
Andrea Faulds
http://ajf.me/

---

## #72872 — Adam Harvey — 2014-02-28T18:00:07+00:00

URL: https://externals.io/message/72864#72872 · In reply to: #72871

>
> 
> > […]
>
>
> I also voted against. I don’t like the [] syntax and PHP 5.6 is too close.

I was also -1, partly for those reasons, but also because I think we
need to take some time (probably in a PHP 5++/6/7/whatever context and
after 5.6 has been frozen) to figure out if we want generics and, if
so, what form they would take syntactically. My guess is that they
won't look anything like ClassName[], and I don't really want another
weird syntax appendix that we have to maintain and document for a
decade or more to come.

Adam

---

## #72885 — mails@thomasbley.de — 2014-03-01T04:09:21+00:00

URL: https://externals.io/message/72864#72885 · In reply to: #72872

Adam Harvey wrote on 28.02.2014 19:00:

> 
> > […]
> 
> I was also -1, partly for those reasons, but also because I think we
> need to take some time (probably in a PHP 5++/6/7/whatever context and
> after 5.6 has been frozen) to figure out if we want generics and, if
> so, what form they would take syntactically. My guess is that they
> won't look anything like ClassName[], and I don't really want another
> weird syntax appendix that we have to maintain and document for a
> decade or more to come.
> 
> Adam
> 
> --
> 
> 
> 


What about adding isarrayof to class declaration?

class DbRow {}

class DbRows isarrayof DbRow {}

function test(DbRows $rows) {}

Regards,
Thomas

---

## #72886 — Marco Schuster — 2014-03-01T06:44:19+00:00

URL: https://externals.io/message/72864#72886 · In reply to: #72885

Hi,


> What about adding isarrayof to class declaration?
>
> class DbRow {}
>
> class DbRows isarrayof DbRow {}
>
> function test(DbRows $rows) {}
>

uh, this doesn't make any sense, I'm afraid. You're after C++ templates?

Marco


-- 
Marco Schuster
IT-Beratung, Web Development
Blütenstr. 23
80799 München

---

## #72888 — Philip Sturgeon — 2014-03-01T15:08:11+00:00

URL: https://externals.io/message/72864#72888 · In reply to: #72872

> 
> > […]
>
> I was also -1, partly for those reasons, but also because I think we
> need to take some time (probably in a PHP 5++/6/7/whatever context and
> after 5.6 has been frozen) to figure out if we want generics and, if
> so, what form they would take syntactically. My guess is that they
> won't look anything like ClassName[], and I don't really want another
> weird syntax appendix that we have to maintain and document for a
> decade or more to come.
>
> Adam

The trouble with that approach is that we could have this feature now.
It would be useful to many (my twitter feed is blowing up over this
one) and would be very simple for people to understand. It's been
simple to implement and it's just all-round simple.

Generics on the other hand are somewhat less simple, we need to work
out templates and all that other fun stuff, and we need to work out if
people even want the feature. Behind the scenes there is a LOT of code
to change and things will have to have a major overhaul. So in the end
we could miss out on adding a great feature that plenty of people want
purely to find out that nobody wanted generics anyway.

This should not even be seen as a rush to implement a weak version
that ruins things and gives us a weird double syntax. It should be
seen as a simple version then if later on generics are implemented
they are a much more powerful feature which has a different syntax.
People can use [] without ever having to understand the complexity of
generics and templates and all that.

At this point suggesting we shouldn't have [] and should make everyone
use generics feels a little bit like banning fishing rods but handing
out grenades.

---

## #72889 — Andrea Faulds — 2014-03-01T15:14:52+00:00

URL: https://externals.io/message/72864#72889 · In reply to: #72888

> This should not even be seen as a rush to implement a weak version
> that ruins things and gives us a weird double syntax. It should be
> seen as a simple version then if later on generics are implemented
> they are a much more powerful feature which has a different syntax.
> People can use [] without ever having to understand the complexity of
> generics and templates and all that.

People can also use Array<Foo> without fully understanding generics.

--
Andrea Faulds
http://ajf.me/

---

## #72890 — Philip Sturgeon — 2014-03-01T15:20:50+00:00

URL: https://externals.io/message/72864#72890 · In reply to: #72889

>
> 
>
> This should not even be seen as a rush to implement a weak version
> that ruins things and gives us a weird double syntax. It should be
> seen as a simple version then if later on generics are implemented
> they are a much more powerful feature which has a different syntax.
> People can use [] without ever having to understand the complexity of
> generics and templates and all that.
>
>
> People can also use Array<Foo> without fully understanding generics.
>
> --
> Andrea Faulds
> http://ajf.me/

If we do a very careful job of documenting them, because introducing
developers to the basic levels without distracting and confusing with
the advanced stuff is gonna be tricky.

My other fallback argument in this case is... "JAVA DID IT".

("Simpsons did it" reference. Anyone?)

The point of my survey was to ask if people wanted just this feature,
generics, or both. Lots of people said both. It's not completely alien
for a language to have both, as Java does this too. I'm sure others do
it we poke around enough.

It also lines up nicely with the syntax everyone is using for
DocBlocks, so again, why not have it now and have some other syntax
for a slightly more powerful feature in the future maybe.

---

## #72891 — Andrea Faulds — 2014-03-01T15:22:14+00:00

URL: https://externals.io/message/72864#72891 · In reply to: #72890

> It also lines up nicely with the syntax everyone is using for
> DocBlocks, so again, why not have it now and have some other syntax
> for a slightly more powerful feature in the future maybe.


Or, we could have generics-like syntax now and add proper generics later, meaning people would get a free performance boost eventually and we’d be able to eliminate the O(n) issue.

--
Andrea Faulds
http://ajf.me/

---

## #72892 — Philip Sturgeon — 2014-03-01T15:25:51+00:00

URL: https://externals.io/message/72864#72892 · In reply to: #72891

>
> 
>
> It also lines up nicely with the syntax everyone is using for
> DocBlocks, so again, why not have it now and have some other syntax
> for a slightly more powerful feature in the future maybe.
>
>
> Or, we could have generics-like syntax now and add proper generics later,
> meaning people would get a free performance boost eventually and we'd be
> able to eliminate the O(n) issue.
>
> --
> Andrea Faulds
> http://ajf.me/
>
>
>
>

And again I say that is something that will be considered if this vote
doesn't pass.

"Array of" using Generics-like syntax in 5.7 and full on generics in
5++ (6 or 7) is looking like a more likely route at this point. It's
just one that I personally don't like. :)

---

## #72910 — guilhermeblanco@gmail.com — 2014-03-03T20:39:14+00:00

URL: https://externals.io/message/72864#72910 · In reply to: #72892

FYI, I changed my vote from +1 to -1.

I like the idea (the +1 part), but I don't think it's the right way to fix
it (the -1 part).
Generics would solve this in a nicer way without being impacted by an O(n)
problem of type checking.
I'd second a Collection support with array_* integration which would make
everything much nicer too.

Cheers,



On Sat, Mar 1, 2014 at 10:25 AM, Philip Sturgeon <pjsturgeon@gmail.com>wrote:

> 
> > […]
>
> And again I say that is something that will be considered if this vote
> doesn't pass.
>
> "Array of" using Generics-like syntax in 5.7 and full on generics in
> 5++ (6 or 7) is looking like a more likely route at this point. It's
> just one that I personally don't like. :)
>
> --
> 
> 
>
>


-- 
Guilherme Blanco
MSN: guilhermeblanco@hotmail.com
GTalk: guilhermeblanco
Toronto - ON/Canada
