Perfect Enums in PHP
<p>Recently i came up with this solution for enums in php:</p>

<pre><code>    class Enum implements Iterator {
        private $vars = array();
        private $keys = array();
        private $currentPosition = 0;

        public function __construct() {
        }

        public function current() {
            return $this-&gt;vars[$this-&gt;keys[$this-&gt;currentPosition]];
        }

        public function key() {
            return $this-&gt;keys[$this-&gt;currentPosition];
        }

        public function next() {
            $this-&gt;currentPosition++;
        }

        public function rewind() {
            $this-&gt;currentPosition = 0;
            $reflection = new ReflectionClass(get_class($this));
            $this-&gt;vars = $reflection-&gt;getConstants();
            $this-&gt;keys = array_keys($this-&gt;vars);
        }

        public function valid() {
            return $this-&gt;currentPosition &lt; count($this-&gt;vars);
        }

}
</code></pre>

<p>Example:</p>

<pre><code>class ApplicationMode extends Enum
{
    const production = 'production';
    const development = 'development';
}

class Application {
    public static function Run(ApplicationMode $mode) {
        if ($mode == ApplicationMode::production) {
        //run application in production mode
        }
        elseif ($mode == ApplicationMode::development) {
            //run application in development mode
        }
    }
}

Application::Run(ApplicationMode::production);
foreach (new ApplicationMode as $mode) {
    Application::Run($mode);
}
</code></pre>

<p>it works just perfect, i got IDE hints, i can iterate through all my enums but i think i miss some enums features that can be useful. 
so my question is: what features can i add to make more use of enums or to make it more practical to use?</p>
