Re: Property Accessors v1.2 : Typehints / Accessor Syntax
| From: | Amaury Bouchard | Date: | Tue, 16 Oct 2012 09:51:07 +0000 |
| Subject: | Re: Property Accessors v1.2 : Typehints / Accessor Syntax | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63442@lists.php.net to get a copy of this message | ||
2012/10/16 Stas Malyshev <smalyshev@sugarcrm.com>
> >> public DateTime $date;
> >
> > This is *real* progress, even if under the hood all it does is wrap
>
> I think it's a movement in wrong direction. Again, it is an attempt to
> make PHP a strongly typed language, which would not work well in a
> dynamic language like PHP, for reasons that were amply explained in 9000
> discussions we had on this topic before.
Not necessarily strongly typed. (sorry to land on this topic afterwards)
As I see PHP, it's a language that can be used as an informal scripting
language, but also as a rock-solid modern tool.
Type hinting in parameters is a really good thing, and it doesn't
transformed PHP in a strongly typed language.
Doing the same for object properties (always optional) could be very useful.