You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed you've got is_scalar() testing, then a cast to string, which takes place on 4 so that it's '4'. Was just curious why you wouldn't filter int out for alpha when array, keys:int will exclude 'a', 'b' and 'c'.
Shouldn't the string test just be is_string()? Maybe calls for the addition of array, keys:scalar?
The text was updated successfully, but these errors were encountered:
The problem is an array can't have a key of "4". Try doing $arr["4"] = true; and you'll see that PHP internally converts the "4" into an integer. Yay to consistency.
That's why for array keys ints are accepted for strings.
Doesn't remove
4
.I noticed you've got
is_scalar()
testing, then a cast to string, which takes place on4
so that it's'4'
. Was just curious why you wouldn't filterint
out foralpha
whenarray, keys:int
will exclude'a'
,'b'
and'c'
.Shouldn't the
string
test just beis_string()
? Maybe calls for the addition ofarray, keys:scalar
?The text was updated successfully, but these errors were encountered: