src/Carbon/Traits/Macro.php
public static function genericMacro($macro, $priority = 0)
    {
        if (!isset(static::$globalGenericMacros[$priority])) {
            static::$globalGenericMacros[$priority] = [];
            krsort(static::$globalGenericMacros, SORT_NUMERIC);
        }

        static::$globalGenericMacros[$priority][] = $macro;
    }
public static function genericMacro($macro, $priority = 0)
    {
        if (!isset(static::$globalGenericMacros[$priority])) {
            static::$globalGenericMacros[$priority] = [];
            krsort(static::$globalGenericMacros, SORT_NUMERIC);
        }

        static::$globalGenericMacros[$priority][] = $macro;
    }
public static function genericMacro ( $ macro , $ priority = 0 ) { if ( ! isset ( static :: $ globalGenericMacros [ $ priority ] ) ) { static :: $ globalGenericMacros [ $ priority ] = [ ] ; krsort ( static :: $ globalGenericMacros , SORT_NUMERIC ) ; } static :: $ globalGenericMacros [ $ priority ] [ ] = $ macro ; }
Register a custom macro.

@param object|callable $macro
@param int             $priority marco with higher priority is tried first

@return void
Register a custom macro .