(PHP 5, PHP 7, PHP 8)
這個(gè)迭代器允許在遍歷數(shù)組和對(duì)象時(shí)刪除和更新值與鍵。
當(dāng)你想多次遍歷相同數(shù)組時(shí)你需要實(shí)例化 ArrayObject,然后讓這個(gè)實(shí)例創(chuàng)建一個(gè) ArrayIterator 實(shí)例。 當(dāng)你想遍歷相同數(shù)組時(shí)多次你需要實(shí)例 ArrayObject 并且讓這個(gè)實(shí)例創(chuàng)建一個(gè) ArrayIterator 實(shí)例,然后使用 foreach 或者手動(dòng)調(diào)用 getIterator() 方法。
ArrayIterator::STD_PROP_LIST
Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).
ArrayIterator::ARRAY_AS_PROPS
可以通過屬性訪問條目(讀寫都支持)。