--TEST-- Test array_key_exists() function : usage variations - floats and casting to ints --FILE-- getMessage() . "\n"; } echo "Cast float to int:\n"; var_dump(array_key_exists((int)$key, $search)); } echo "Done"; ?> --EXPECT-- *** Testing array_key_exists() : usage variations *** -- Iteration 1 -- Pass float as $key: bool(true) Cast float to int: bool(true) -- Iteration 1 -- Pass float as $key: bool(true) Cast float to int: bool(true) -- Iteration 1 -- Pass float as $key: bool(true) Cast float to int: bool(true) Done