Re: [RFC] Scalar Type Hinting With Casts (re-opening)
| From: | Rowan Collins | Date: | Mon, 14 Jul 2014 18:35:20 +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 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75506@lists.php.net to get a copy of this message | ||
Andrea Faulds wrote (on 14/07/2014):
Arguably it’s inconsistent for the scalar and non-scalar type hints to work slightly differently, but the point is that we’d be doing what makes sense for arrays (no meaningful casts, so we don’t casts) and what makes sense for the scalar types (there are common, sensible, meaningful, lossless and equivalent casts, so we’ll do them).Just for the record, I am absolutely on board with not treating array casts as "lossless". What I am not keen on in is allowing "lossy" casts to int using the same syntax that refuses "lossy" casts to array, which is what Zeev and others are suggesting.
That’s my final word on this matter.Fair enough. I've probably repeated myself too much as well. :)