public static function clearExcept(array $keepInstanceNames)
    {
        foreach (self::$instances as $name => $instance) {
            if (!in_array($name, $keepInstanceNames)) {
                self::clear($name);
            }
        }
    }
public static function clearExcept(array $keepInstanceNames)
    {
        foreach (self::$instances as $name => $instance) {
            if (!in_array($name, $keepInstanceNames)) {
                self::clear($name);
            }
        }
    }
public static function clearExcept ( array $ keepInstanceNames ) { foreach ( self :: $ instances as $ name => $ instance ) { if ( ! in_array ( $ name , $ keepInstanceNames ) ) { self :: clear ( $ name ) ; } } }
Remove all stored instances but KEEP the passed instance names.

@param string[] $keepInstanceNames
Remove all stored instances but KEEP the passed instance names .