Re: Generics proposal
| From: | Christian Schneider | Date: | Mon, 22 Oct 2012 22:57:37 +0000 |
| Subject: | Re: Generics proposal | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63604@lists.php.net to get a copy of this message | ||
Am 22.10.2012 um 21:44 schrieb Anthony Ferrara <ircmaxell@gmail.com>:
> This is not about turning PHP into Java. Can we get over that old rhetoric
> already? Instead of bashing proposals like this, can we discuss them,
> instead of this hatred for all things strict?
>
> With that aside, I have mixed feelings on this.
… and while it might not be about turning PHP into Java it might still be worthwhile to read a bit
about experiences with Generics in Java: http://www.artima.com/weblogs/viewpost.jsp?thread=299081
Basically it means that you type more (redundant) stuff to allow the compiler to check some errors.
And while type hints and PPP are along the same line I think the main difference is that they put
the burden on the declarations, not on the users of an API.
That said I'm not even using type hints of PPP and sometimes it would be handy if internal
functions would be less strict about their parameters (e.g. debug_backtrace() not accepting two
arguments in PHP < 5.4 and return null in that case instead of silently ignoring the extra
parameter).
- Chris