3 ms·
From a grammar perspective, it seems odd to declare property types as prefixes instead of matching the return type syntax. Were suffixed types considered? cl
by jonhohle 10y ago
From a grammar perspective, it seems odd to declare property types as prefixes instead of matching the return type syntax. Were suffixed types considered?
class Person
{
public $name : string;
public $age : int;
public $isEmployee : bool;
}
- TazeTSchnitzel 10y agoWell, we don't use suffixes for parameter types: public function __construct(string $name, int $age, bool $isEmployee); And all other qualifiers (`static`, `public`/`protected`/`private`) come before the property name, so why should the type be any different? Hack doesn't do this either. I do think the idea came up.