Hi,
I would love to see generics in PHP, but I have a few questions for your RFC.class Bazz<Foo : \Bar> Why did you use this syntax for forcing extending/implementation? I know this is the syntax C# uses, but it doesn't fit PHP. I think it should be "extends" or "implements", because in PHP : has a different meaning.
I've used a different syntax before (namely "extends" and "implements"), but someone pointed out, that a keyword-less version would make more sense, so I updated it appropriately. If someone has a better suggestion, I'm happy to include it in the RFC.
Also, how do you specify multiple constraints?
I didn't plan on covering multiple constraints here, as we don't handle them at all in PHP yet. Although I've read that someone wanted to have Union-types in PHP, which could be used here as well I suppose.
Do you have any idea how it would work internally and if there was some performance hit while using generics, and if it would also slow down existing apps that don't use generics?
I don't have enough insights in the PHP guts to make a good suggestion about this, but I'd assume that it should not have a negative performance effect on code which doesn't use generics.
I hope this RFC will have positive comments, and someone who is capable of writing C will help you out with it so there's a patch for people to review - because I'm not sure if this RFC can get anywhere without a patch. :( Regards Pavel Kouril
-- Ben Scholzen http://www.dasprids.de
smime.p7s
Description: S/MIME Cryptographic Signature