public static function indexOf($array, $item)
    {
        if (is_array($array))
            return ($key = array_search($item, $array)) !== false ? $key : -1;

        $found = -1;
        $search = $item;
        static::each($array, function($item, $key) use ($search, & $found) {
            if ($item == $search) {
                $found = $key;
                return static::BREAKER;
            }
        });

        return $found;
    }
public static function indexOf($array, $item)
    {
        if (is_array($array))
            return ($key = array_search($item, $array)) !== false ? $key : -1;

        $found = -1;
        $search = $item;
        static::each($array, function($item, $key) use ($search, & $found) {
            if ($item == $search) {
                $found = $key;
                return static::BREAKER;
            }
        });

        return $found;
    }
public static function indexOf ( $ array , $ item ) { if ( is_array ( $ array ) ) return ( $ key = array_search ( $ item , $ array ) ) !== false ? $ key : - 1 ; $ found = - 1 ; $ search = $ item ; static :: each ( $ array , function ( $ item , $ key ) use ( $ search , & $ found ) { if ( $ item == $ search ) { $ found = $ key ; return static :: BREAKER ; } } ) ; return $ found ; }
Returns the index at which value can be found in the array, or -1 if value is not present in the array. This
method uses array_search internally and is not optimized for long array binary search.

@category Array Functions

@param traversable $array the list of items
@param mixed $item the value to look for

@return mixed
Returns the index at which value can be found in the array or - 1 if value is not present in the array . This method uses array_search internally and is not optimized for long array binary search .