data = loco_include( $path ); $this->name = $name; } public function destroy(){ unset( self::$reg[$this->name], $this->data ); } public function offsetGet( $k ){ return isset($this->data[$k]) ? $this->data[$k] : null; } public function offsetExists( $k ){ return isset($this->data[$k]); } public function offsetUnset( $k ){ throw new RuntimeException('Read only'); } public function offsetSet( $k, $v ){ throw new RuntimeException('Read only'); } public function count(){ return count($this->data); } /** * Implements IteratorAggregate::getIterator * @return ArrayIterator */ public function getIterator(){ return new ArrayIterator( $this->data ); } }