<?php

class Session {

    protected static $iterations = array();

    static public function getInst($params = array()) {
        $iteration = $params['iteration'];

        if (!isset(self::$iterations[$iteration])) {
            self::$iterations[$iteration] = new self($params);
        }

        return self::$iterations[$iteration];
    }

    public function __construct($param) {
        $this->params = $param;
    }

}

$sess = Session::getInst(array('iteration' => 'start', 'param1' => 'param1', 'param2' => 'param2', 'param3' => 'param3'));
