Am 19.12.2017 um 19:19 schrieb Fleshgrinder:
On 12/19/2017 6:43 PM, Andreas Hennings wrote:
The argument, which I support, is that "mixed" would allow to
distinguish against cases of "developer forgot to add a type hint" or
"no type hint due to legacy / BC reasons".
Also, with a "mixed" type hint, you know it is not "void" (this is
still the same argument).

The developer forgot the type constraint if there is no type constraint in:

1. the code
2. the DocBlock

This is a simple rule that you can already adopt without any changes to
the language. The thing is that mixed is not required at all at the
moment PHP supports more sophisticated type constructs. As I said
earlier, pursue them, not this.

PS: It's interesting how people fail to see the power of union and
intersection. This is currently happening on the Kotlin side too.

A simple example for a union type was already given: `string|int`

i see the power and have hundrets of definitions where i would add such hints instead nothing if it would be supported

but that's a different thing and both don't collide

"It's a simple alias for the current behavior of no type and is fully interchangeable" from this RFC about mixed is completly unrelated to union types

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

Reply via email to