How does Zend Registry work

zend-framework

Solution

Zend_Registry is a wrapper around `static` type variable storing an array .

Static variable defination from wikipedia

In computer programming, a static variable is a variable that has been allocated statically — whose lifetime extends across the entire run of the program.

Similarly variables stored inside Zend_Registry extends across the entire run of the program.

A simple My Registry class

    class My_Registry
    {
    static $storage;

   public static function set($key,$value)
    {
    self::$storage[$key] = $value;
    }


 public static function get($key)
    {
    return self::$storage[$key];
    }
    }

Problem

I am wondering if Zend_Registry uses phpMemory, sessions or another method. This question is more my curiousity. ``` Zend_Registry::set('test', array()); ```

Original source