Re: [RFC] Scalar Type Hinting With Casts (re-opening)
| From: | Rowan Collins | Date: | Mon, 14 Jul 2014 17:38:48 +0000 |
| Subject: | Re: [RFC] Scalar Type Hinting With Casts (re-opening) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75500@lists.php.net to get a copy of this message | ||
Andrea Faulds wrote (on 14/07/2014):
On 14 Jul 2014, at 18:24, Rowan Collins <rowan.collins@gmail.com> wrote:Lossless, no. Meaningful, yes. As mentioned earlier, the behaviour of this statement is as useful as any other forced cast: foreach ( (array)$foo as $bar )If the current type hints were only for objects, I would be OK with that, but I really don't get why an array cast is so different from an int cast.I’m don’t think the result of casting to array is meaningful or lossless for anything