array_key_exists call is now using cast type to array for second argument to mitigate incompatibility with newer php versions