I mean is $item_id checked if it exists before running this method? If not, shouldn't it show a PHP notice if the offset that is defined by $item_id doesn't exist?