You need to use !==for comparison:
return $arr !== array_keys( $arr );
This generates the correct conclusion , which is true.
Otherwise, type juggling will consider the values ββfor an array of single elements equal:
array(1) { [0]=> string(1) "a" }
array(1) { [0]=> int(0) }
"a" == 0 ( "a" 0), "a" === 0 false.