AW: [PHP-DEV] Renaming type-hints to something else?

From: Date: Tue, 16 Sep 2014 19:09:33 +0000
Subject: AW: [PHP-DEV] Renaming type-hints to something else?
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-77270@lists.php.net to get a copy of this message
> -----Ursprüngliche Nachricht----- > Von: Andrea Faulds [mailto:ajf@ajf.me] > Gesendet: Dienstag, 16. September 2014 17:26 > An: Levi Morrison > Cc: internals > Betreff: Re: [PHP-DEV] Renaming type-hints to something else? > > > On 16 Sep 2014, at 16:24, Levi Morrison <levim@php.net> wrote: > > > On Tue, Sep 16, 2014 at 9:16 AM, Andrea Faulds <ajf@ajf.me> wrote: > >> > >> The general concept should be called Optional Type Declarations, to replace “Type Hinting". They are type declarations, > and they are optional. Thus the name. For the things themselves, they’re just Type Declarations, to replace “Type Hints". > > > > My worry about "optional type declarations" is that once a type is > > present it isn't optional anymore. Could be confusing and I am unsure > > if that's any better than a "type hint". > > > > If we change it, maybe just call them "type declarations". I think > > just referring to them as "types" could be too ambiguous. > > I agree. Let’s just call them “Type Declarations” then. > -- I would argue "type declaration" is wrong as well since it is not a type declaration as it is known in other languages where the type declaration is binding. IMO it is more a "type check". Consider the following function foo(Bar $b){ $b = 1; //$b is not a Bar at all }

« previous php.internals (#77270) next »