My problem is I want to map by object equality (==), not unique instances. In other words, refactor this to not throw an error and return the mapped value:
$var1 = (object) [1,2,10];
$var2 = (object) [1,2,10];
$objmap = new SplObjectStorage();
$objmap[$var1] = "mapped value here";
echo $objmap[$var2];
Edit: Also, if I end up needing to iterate over the keys of the SplObjectStorage object to get by equality, I'd like instead to know a good way to just hash objects/arrays and simply map to the hashes.