src/arr/Arr.php
public static function add(&$arr, $obj, $prepend = false)
    {
        if ($prepend) {
            array_unshift($arr, $obj);
        } else {
            array_push($arr, $obj);
        }

        return $arr;
    }
public static function add(&$arr, $obj, $prepend = false)
    {
        if ($prepend) {
            array_unshift($arr, $obj);
        } else {
            array_push($arr, $obj);
        }

        return $arr;
    }
public static function add ( & $ arr , $ obj , $ prepend = false ) { if ( $ prepend ) { array_unshift ( $ arr , $ obj ) ; } else { array_push ( $ arr , $ obj ) ; } return $ arr ; }
Appends or prepends an object into an array.

@param array   $arr     Array object (passed by reference)
@param mixed   $obj     Object
@param boolean $prepend Inserts at the beginning (default is false)

@return array
Appends or prepends an object into an array .