On 26 November 2014 10:21:12 GMT, Lazare Inepologlou <linep...@gmail.com> wrote:
>http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)#Covariant_method_return_type

Can I just recommend that everyone interested in this discussion read that 
whole article (at least until it gets into the guts of generics, which gets 
more and more complex). It explains the concepts extremely clearly, both in 
their theoretical basis and their practical implementation and limitations.

I often worry that PHP is designed too much around examples and use cases, 
rather than more formal theoretical foundations, so I'm pleased this 
conversation has led me to learn those concepts. Obviously, that article points 
out, there is sometimes value in ignoring the theoretically pure in favour of 
the practical, but the adage applies that you should first understand the rules 
before deciding to break them.

Regards,
-- 
Rowan Collins
[IMSoP]


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to