Re: [RFC Discussion] Typed Properties

From: Date: Wed, 30 Mar 2016 12:18:42 +0000
Subject: Re: [RFC Discussion] Typed Properties
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-92023@lists.php.net to get a copy of this message
On Wed, 2016-03-30 at 04:16 +0100, Joe Watkins wrote: > > 2) The handling of multiple properties in the same declaration statement > is inconsistent. > > This feels consistent to me .. in other languages where the type is > required, it makes sense to assume the type is implied. > > In a language where the type is optional, public int $foo, $bar; feels > ambiguous to me. We support $ php -r 'class C { private static $a, $b; } echo new ReflectionClass("C");' [...] - Static properties [2] { Property [ <default> private static $a ] Property [ <default> private static $b ] [...] I believe handling the type attribute like access attributes would be consistent. But well, unless we have typed variables etc. this is inconsistent anyways. Maybe we should actually discuss making PHP fully typed and making that consistent instead of adding one piece of typing step by step. johannes

« previous php.internals (#92023) next »