草庐IT

valueObject

全部标签

php - PHP 中的 SplObjectStorage 和含糖语法

快点;我怀疑这是可能的,但是有什么方法可以利用array($key=>$value);PHP的语法来处理SplObjectStorage对象?我的意思是,有没有这样的方法可以实现:$store=//?newKeyObject()=>newValueObject(),newKeyObject()=>newValueObject(),//...在初始化对象存储的上下文中?目前我只是在使用:(并且可能会继续,考虑到这种可能性的绝对可能性)$store=newSplObjectStorage();$store[newKeyObject()]=newValueObject();$store[ne