/** * If passed an array of ints we don't need to a whole slew of other testing * # THIS FUNCTION IS IN HERE FOR PERFORMACE REASONS ONLY * @param mixed $data * @return array */ protected function addHelper($data) { // if this is a array of real integers we can short circuit further testing if (is_array($data)) { // are we an array of ints reset($data); $isInt = true; while ($isInt && (list(, $value) = each($data))) { $isInt = ($isInt and is_int($value)); } if ($isInt) { // sort integers // means the slower, null safe, interval function has less work to do sort($data, SORT_NUMERIC); return array_map(null, $data, $data); } } return parent::addHelper($data); }