Am 29.12.2017 um 16:37 schrieb Nikita Popov:
Regarding the union type RFCs, from what I remember, one of my personal
issues with it were the complex rules involving scalar type unions in weak
typing mode. It's non-trivial to decide what a value should be casted to if
it does not have the correct type. It's sort of clear what "1.5" passed to
an int|float union becomes, but it's not intuitively obvious what should
happen if you pass "foo" to a bool|int union, etc.

in case of "bool|int" cast it to bool
in case of "int|bool" cast it to int

first comes, first serve



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

Reply via email to