githubeing

Results 26 comments of githubeing
trafficstars

or even something like ``` class MyIntegerHashable implements Hashable { private $int; public function __construct($int) { $this->int = $int; } public function hashable($var) { if (is_integer($var)) { return $var ===...

i understood now. ok, so this is a docs mistake. could you fix that or should i file a bug report there? (i don't know if this is you who...

> I'll update the docs it'd be useful to explain there what "guaranteed" means (that you `return false` internally - this is important to know in which cases my code...

> surely it would have to compare the class exactly? not sure about inheritance though. what if someone treats an object and an object of a child class as equal?...

have i understood you correctly in the following? you think that ext-ds should make it impossible to create a class that will implement Hashable and that will treat equal `(new...

agree. the less magic, the less invisible and not obvious operations - the better a developer understands how it works, the more reliable code they write, the more they're happy...

fyi, `instanceof` can be used to compare strict classes like this: ```php $this instanceof $that and $that instanceof $this ```

is it safe to use IteratorIterator($collection) while modifying the $collection? as i know, ArrayIterator can do this, why Collection cannot? doesn't IteratorIterator create its own iterator or is it using...

e.g. if i want: ``` $iterator = new IteratorIterator($map); $iterator->rewind(); $iterator->current(); $iterator->next(); $iterator->current(); $map->put($key, $value); $iterator->next(); $iterator->current(); ```

my keys implement Hashable, so if Collection cannot do this, i'll have to use ArrayIterator and instead of `$map[$key] = $value;` i will use `$arrayIterator[$key->hash()] = $value;` directly. I just...