public function total()
    {
        $total = array_reduce($this->examples, function($x, $e) {
            $x += $e instanceof Example ? 1 : $e->total();
            return $x;
        }, 0);

        return $total;
    }
public function total()
    {
        $total = array_reduce($this->examples, function($x, $e) {
            $x += $e instanceof Example ? 1 : $e->total();
            return $x;
        }, 0);

        return $total;
    }
public function total ( ) { $ total = array_reduce ( $ this -> examples , function ( $ x , $ e ) { $ x += $ e instanceof Example ? 1 : $ e -> total ( ) ; return $ x ; } , 0 ) ; return $ total ; }
Get total number of tests

@return int
Get total number of tests