public static function get($length = -1, int $offset = 0) : array
    {
        $ret     = [];
        $results = static::$_session->get("_RESULTS");

        if(
            !is_numeric($length)     &&
            isset($results[$length])
        ) {
            $ret = $results[$length]["result"];

            if($results[$length]["type"] === "flash") {
                unset($results[$length]);

                static::$_session->set("_RESULTS", $results);
            }

            return $ret;
        }

        foreach($results as $key => $value) {
            if($offset > 0) {
                $offset--;
                continue;
            }

            $ret[$key] = $$value["result"];

            if($value["type"] == "flash") {
                unset($results[$key]);
            }

            if($length-- == 0) {
                break;
            }
        }

        static::$_session->set("_RESULTS", $results);

        return $ret;
    }
public static function get($length = -1, int $offset = 0) : array
    {
        $ret     = [];
        $results = static::$_session->get("_RESULTS");

        if(
            !is_numeric($length)     &&
            isset($results[$length])
        ) {
            $ret = $results[$length]["result"];

            if($results[$length]["type"] === "flash") {
                unset($results[$length]);

                static::$_session->set("_RESULTS", $results);
            }

            return $ret;
        }

        foreach($results as $key => $value) {
            if($offset > 0) {
                $offset--;
                continue;
            }

            $ret[$key] = $$value["result"];

            if($value["type"] == "flash") {
                unset($results[$key]);
            }

            if($length-- == 0) {
                break;
            }
        }

        static::$_session->set("_RESULTS", $results);

        return $ret;
    }
public static function get ( $ length = - 1 , int $ offset = 0 ) : array { $ ret = [ ] ; $ results = static :: $ _session -> get ( "_RESULTS" ) ; if ( ! is_numeric ( $ length ) && isset ( $ results [ $ length ] ) ) { $ ret = $ results [ $ length ] [ "result" ] ; if ( $ results [ $ length ] [ "type" ] === "flash" ) { unset ( $ results [ $ length ] ) ; static :: $ _session -> set ( "_RESULTS" , $ results ) ; } return $ ret ; } foreach ( $ results as $ key => $ value ) { if ( $ offset > 0 ) { $ offset -- ; continue ; } $ ret [ $ key ] = $ $ value [ "result" ] ; if ( $ value [ "type" ] == "flash" ) { unset ( $ results [ $ key ] ) ; } if ( $ length -- == 0 ) { break ; } } static :: $ _session -> set ( "_RESULTS" , $ results ) ; return $ ret ; }
Returns the results.

@param int|string $length Length of the array to return, if string, the name of the result.
@param int        $offset Array offset.

@return array Array with `$length` results.
Returns the results .