Re: [VOTE][RFC] Coercive Scalar Type Hints

From: Date: Sat, 14 Mar 2015 02:37:42 +0000
Subject: Re: [VOTE][RFC] Coercive Scalar Type Hints
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-84755@lists.php.net to get a copy of this message
Zeev, Dmitry and Francois (and anyone), I have a question on a specific conversion. There has been *a lot* of email about scalar types so I apologize if this is answered somewhere already. It seems that float -> bool is always disallowed. If I am correct int -> bool is permitted for all values (not just 0 and 1), which means that floats which can be converted to integers without dataloss should also be permitted to be booleans. If a specific float can be converted to an int, and all ints can be converted to booleans, then the transitive property should hold for that float to a bool. Am I understanding the current rules correctly? If so can I get more rationale on this? Cheers, Levi Morrison

« previous php.internals (#84755) next »