facebook/hhvm — pull request #1388 by sdboyer (2013-12-19 21:13:39+00:00)
Title: Allow mutation of values on already-existing object keys in SplObjectStorage

The current reimplementation of `SplObjectStorage` does not allow mutation of "info" values attached to object keys in the case where the object is already present in the object. This is inconsistent with PHP's behavior, and while I don't know what the spec says, PHP's behavior seems preferable.

Example:

```php
$storage = new SplObjectStorage();
$obj = new stdClass();
$storage->attach($obj, 'foo');
$storage[$obj] = 'bar'; // of course, this is just an alias for attach(), but the consistency argument is clearer w/this syntax
echo $storage[$obj]; // php outputs 'bar', hhvm outputs 'foo'
```

I've just started tinkering today with hhvm, so I have scarcely any idea about how all of it is laid out, but if I've grokked it right then this small tweak to `SplObjectStorage::attach()` is all it takes to bring hhvm's implementation into line with PHP's...I guess? We'll find out :P

Working on compiling it locally to test, but putting this up here in the meantime.