Re:PHP7 Gains Scalar Type Hints
by mappu on Friday March 20, 2015 @01:56AM
(#9236405)
On the face of it you're technically correct, and i've been bitten by numeric string key coercion in the past. But another way of thinking about it is that PHP's combined array/dict implementation is a perfectly valid set/dict, just over a subset of values where 2 and "2" are not really distinct. And clearly this was intentional given all the other parts of the language that treat types weakly.
[ Parent
| on HN ]
There are no comments on this comment yet.