Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Iteratorを実装するクラスを作成した場合、 foreachのこの機能は引き続き機能しますか?
ループ内で配列要素を直接変更できるようにするには、$value の前に & を付けます。その場合、値は参照によって割り当てられます。
おそらくもっと重要なことですが、Iteratorの宣言に'&' を入れる必要がありcurrent()ますか?
Iterator
current()
できません。PHP 5.3.2 では、
致命的なエラー: [ファイル]行[N]の参照による foreach で反復子を使用することはできません