public static function invert($object)
    {
        if (!is_array($object))
            $castDown = (boolean)$object = static::toArray($object);

        return !empty($castDown) ? (object)array_flip($object) : array_flip($object);
    }
public static function invert($object)
    {
        if (!is_array($object))
            $castDown = (boolean)$object = static::toArray($object);

        return !empty($castDown) ? (object)array_flip($object) : array_flip($object);
    }
public static function invert ( $ object ) { if ( ! is_array ( $ object ) ) $ castDown = ( boolean ) $ object = static :: toArray ( $ object ) ; return ! empty ( $ castDown ) ? ( object ) array_flip ( $ object ) : array_flip ( $ object ) ; }
Returns a copy of the object where the keys have become the values and the values the keys. For this to work,
all of your object's values should be unique and string serializable.

@category Object Functions

@param traversable $object the object to invert

@return object,array
Returns a copy of the object where the keys have become the values and the values the keys . For this to work all of your object s values should be unique and string serializable .