Re: [RFC][Vote] Typed Properties
| From: | Thomas Bley | Date: | Sat, 11 Jun 2016 19:37:55 +0000 |
| Subject: | Re: [RFC][Vote] Typed Properties | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93905@lists.php.net to get a copy of this message | ||
Hi,
what about having "strict classes"?
A strict class would be like a database table, each property defined must have a type.
Each property defined must be initialized before being accessed, or have a default value.
e.g.
strict class Foo {
public int $id;
public bool $enabled;
public DateTime $created;
}
Regards
Thomas
Dmitry Stogov wrote on 10.06.2016 14:37:
> Hi,
>
>
> I hardly worked on implementation of this patch for a week, but I still don't
> like it.
>
> It makes 15% slowdown on each property update in existing PHP code (without
> types), and I don't see a way to improve this.
>
> Update of typed properties is going to be even more expensive.
>
> Benchmark results are included into RFC (and not changed with the latest
> version of the patch).
>
>
> -1.
>
>
> Thanks. Dmitry.
>
> ________________________________
> From: Joe Watkins <pthreads@pthreads.org>
> Sent: Friday, June 10, 2016 1:38:04 PM
> To: PHP internals; Phil Sturgeon
> Subject: [PHP-DEV] [RFC][Vote] Typed Properties
>
> Afternoon internals,
>
> The vote for typed properties has been restarted.
>
> Please take part: https://wiki.php.net/rfc/typed-properties
>
> Cheers
> Joe
>