Example #1
0
 /**
  * @param mixed $key
  * @param mixed $value
  */
 public function put($key, $value)
 {
     $hash = $this->eqComparer->hash($key);
     if (!array_key_exists($hash, $this->values)) {
         $this->keys[] = $key;
     }
     $this->values[$hash] = $value;
 }
Example #2
0
 /**
  * Initializes a new instance of that class.
  *
  * @param mixed $value The value to wrap.
  * @param callable $comparer The custom comparer to use.
  * @param callable $equalityComparer The custom equality comparer to use.
  *
  * @throws ArgumentException $comparer / $equalityComparer is no valid callable / lambda expression.
  */
 public function __construct($value, $comparer = null, $equalityComparer = null)
 {
     $this->_comparer = static::getComparerSafe($comparer);
     parent::__construct($value, $equalityComparer);
 }