fix SplObjectStorage output in future HHVM releases

- Objects are stored indexed by hash
- However, when iterating, key() needs to return 0..n instead

So, HHVM's added a variable to keep track of the fake key.
This commit is contained in:
Fred Emmott 2014-02-13 11:11:26 -08:00
parent 96262075d7
commit 5277ca9d11
1 changed files with 3 additions and 0 deletions

View File

@ -280,6 +280,9 @@ class Exporter
} else if (property_exists('\SplObjectStorage', 'storage')) {
unset($array['storage']);
}
if (property_exists('\SplObjectStorage', '__key')) {
unset($array['__key']);
}
foreach ($value as $key => $val) {
$array[spl_object_hash($val)] = array(
'obj' => $val,