Quick; I doubt it is possible, but is there a way to use the syntax array($key => $value);
PHP regarding SplObjectStorage
objects?
I mean, is there such a way:
$store = // ? new KeyObject() => new ValueObject(), new KeyObject() => new ValueObject(), // ...
In the context of object store initialization? At the time I just use: (and will probably continue, given that there is a clear probability that this is possible)
$store = new SplObjectStorage(); $store[new KeyObject()] = new ValueObject(); $store[new KeyObject()] = new ValueObject();
It would be nice, I doubt it very much, but maybe someone knows better.
source share