src/Helper/Arr.php
public static function compact($array, $reindex = false)
    {
        $out = array_filter($array, function ($item) {
            return false !== (bool)$item;
        });

        return false !== $reindex && self::isList($out) ? array_values($out) : $out;
    }
public static function compact($array, $reindex = false)
    {
        $out = array_filter($array, function ($item) {
            return false !== (bool)$item;
        });

        return false !== $reindex && self::isList($out) ? array_values($out) : $out;
    }
public static function compact ( $ array , $ reindex = false ) { $ out = array_filter ( $ array , function ( $ item ) { return false !== ( bool ) $ item ; } ) ; return false !== $ reindex && self :: isList ( $ out ) ? array_values ( $ out ) : $ out ; }
Filters out boolish items that resemble none "truthy" values.

@return array
Filters out boolish items that resemble none truthy values .