Return reference to parameter
<p>is any way to return reference at class parameter or global variable? I try this</p>

<pre><code>class test{

  public static $var;

  public static function get(&amp;$ref){

    $ref = self::$var;

  }

}

test::get($ref);
$ref = 'test';
var_dump(test::$var);
</code></pre>

<p>it's a basic example, i know, then this example can be use another way, but i need to keep principle</p>

<hr>

<p>this is my function, where is problem with reference to variable</p>

<pre><code>class mySession{

    public static function issetKeys(){

      $keys = func_get_args();

      $session = &amp;$_SESSION;
      $c = 0;

      if (is_array($keys)){
        foreach ($keys as $val){

          if (isset($session[$val])){
            $session = &amp;$session[$val];
            $c++;
          }
          else break;

        }
      }

      return $c == count($keys);

    }

    public static function &amp;get(){

      $keys = func_get_args();

      $session = &amp;$_SESSION;

      if (is_array($keys)){
        foreach ($keys as $val){

          if (!isset($session[$val])) $session[$val] = Array();
          $session = &amp;$session[$val];

        }
      }

      return $session;

    }

  }

  function getValue(){

    if (!mySession::issetKeys('p1', 'p2')){
      $session = mySession::get('p1', 'p2');
      $session = 'string';
    }

    return mySession::get('p1', 'p2');

  }

  print_r($_SESSION);
</code></pre>

<p>but no variable save in to $_SESSION</p>
