Stricter array check to prevent PHP notices