_d[$k] ) ) exit ( sprintf ( 'Duplicate key "%s" found.', $k ) ); $this->_d[$k] = $v; } function search ( $k ) { return isset ( $this->_d[$k] ) ? $this->_d[$k] : false; } function delete ( $k ) { unset ( $this->_d[$k] ); } function get_first ( ) { reset ( $this->_d ); $x = each ( $this->_d ); return array ( $x[0] => $x[1] ); } function get_last ( ) { end ( $this->_d ); $x = each ( $this->_d ); return array ( $x[0] => $x[1] ); } function get_all ( ) { return $this->_d; } function get_count ( ) { return count ( $this->_d ); } function update_value ( $k, $nv ) { if ( isset ( $this->_d[$k] ) ) { $this->_d[$k] = $nv; return true; } return false; } function update_key ( $k, $nk ) { if ( isset ( $this->_d[$k] ) ) { $v = $this->_d[$k]; unset ( $this->_d[$k] ); $this->_d[$nk] = $v; return true; } return false; } } ?>