Re: [RFC] Typed Properties

From: Date: Thu, 21 Jun 2018 13:15:25 +0000
Subject: Re: [RFC] Typed Properties
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-102341@lists.php.net to get a copy of this message
Nikita, Bob I'd love to thank you and everyone involved on this one. Types properties on PHP is something that we tried before, but due to a number of issues, we didn't make it. Unfortunately, I don't have the knowledge to help in the implementation, but I'd like to drop some comments about the syntax. As described in https://wiki.php.net/rfc/typed_properties_v2#syntax, I think we should only allow class Example { public int $num; public string $name; } Allow the : variant (public $num: int;) would bring a lot of doubts for new users, and the {visibility} {type} {name} is prett consistence in other languages. Again, thanks for this amazing work, and let's make for the next PHP version :) -- Gabriel Caruso

« previous php.internals (#102341) next »