Re: [RFC] [DISCUSSION] Scalar Pseudo-type

From: Date: Fri, 29 Dec 2017 15:43:38 +0000
Subject: Re: [RFC] [DISCUSSION] Scalar Pseudo-type
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-101441@lists.php.net to get a copy of this message
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

« previous php.internals (#101441) next »