
Fred Rosenbaum - 2010-08-28 20:36:43
Looking for a PHP dictionary implementation, this is the first one I looked at. It is small, and works. I like that.
I have added a get($key) function, defined in the interface and implemented in the class. I may add more functionality to make it more like the C# and C++ STL equivalents as that is what I am used to.
In IDictionary:
public function get( $key );
In Dictionary:
public function get( $key )
{
if ( !self::exists($key) )
throw new Exception("The given key does not exist");
return $this->items[$key];
}