> -----Ursprüngliche Nachricht-----
> Von: Lazare Inepologlou [mailto:linep...@gmail.com]
> Gesendet: Dienstag, 31. März 2015 00:01
> An: Christoph Becker
> Cc: Zeev Suraski; PHP internals
> Betreff: Re: [PHP-DEV] Re: Naming of 'weak' type hints
> 
> Zeev Suraski wrote:
> 
> > One thing that I think we should change is how we refer to the ‘weak’
> > type hints.  The word ‘weak’ has a negative ring to it, and
> > considering this is how the language behaves across the board it’s a
> > pretty bad name for this feature.
> 
> Borrowing from C#, I would suggest the names implicit and explicit argument 
> types. There is nothing "weak" about them,
> they just do an implicit conversion which can be quite powerful if used 
> correctly.
>

[Robert Stoll] 
It's probably hard to come up with something which does not conflict with 
another concept, but implicit and explicit typing is used to refer to two sub 
categories of static typing. Explicit typing refers to code which requires 
explicit type specifications written by the user and implicit typing is the 
case where type inference infers the types.

I am not so sure if it is clever to use an own name for type hints when 
strict_types=1 since the type hint as such is not different, the context is 
different. I am think about it in the sense that a function has different 
overloads and depending on the context some are available and others are not 
(similar to the callee of a method call, strict_types=1 can be seen as another 
argument). But I guess that is too complicated for a documentation. 
Nevertheless, I would put emphasis on the fact that the context is different. 

> In the future, I hope that we will have implicit object conversions in 
> addition to the scalar ones.

[Robert Stoll] 
That would be nice :)

> 
> 
> 
> Lazare INEPOLOGLOU
> Ingénieur Logiciel


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to