public static function add(array $array, $key, $value): array
    {
        $target = static::get($array, $key, []);

        if (! is_array($target)) {
            $target = [$target];
        }

        $target[] = $value;
        $array = static::set($array, $key, $target);

        return $array;
    }
public static function add(array $array, $key, $value): array
    {
        $target = static::get($array, $key, []);

        if (! is_array($target)) {
            $target = [$target];
        }

        $target[] = $value;
        $array = static::set($array, $key, $target);

        return $array;
    }
public static function add ( array $ array , $ key , $ value ) : array { $ target = static :: get ( $ array , $ key , [ ] ) ; if ( ! is_array ( $ target ) ) { $ target = [ $ target ] ; } $ target [ ] = $ value ; $ array = static :: set ( $ array , $ key , $ target ) ; return $ array ; }
Add an element to the array at a specific location
using the "dot" notation.

@param array                  $array
@param string[]|callable|null $key
@param mixed                  $value

@return array
Add an element to the array at a specific location using the dot notation .