svn: /phpdoc/ja/trunk/reference/spl/arrayiterator/ offsetunset.xml

From: Date: Wed, 10 Jun 2020 18:25:52 +0000
Subject: svn: /phpdoc/ja/trunk/reference/spl/arrayiterator/ offsetunset.xml
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-5682@lists.php.net to get a copy of this message
mumumu Wed, 10 Jun 2020 18:25:52 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=350028 Log: Add note on behavior of ArrayIterator::offsetUnset when used on current iteration index Patch by Alex Dowad. Closes php/doc-en#118 Bug: https://bugs.php.net/118 (error getting bug information) Changed paths: U phpdoc/ja/trunk/reference/spl/arrayiterator/offsetunset.xml Modified: phpdoc/ja/trunk/reference/spl/arrayiterator/offsetunset.xml =================================================================== --- phpdoc/ja/trunk/reference/spl/arrayiterator/offsetunset.xml 2020-06-10 18:25:18 UTC (rev 350027) +++ phpdoc/ja/trunk/reference/spl/arrayiterator/offsetunset.xml 2020-06-10 18:25:52 UTC (rev 350028) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> -<!-- EN-Revision: 345631 Maintainer: takagi Status: ready --> +<!-- EN-Revision: 350025 Maintainer: takagi Status: ready --> <!-- Credits: mumumu --> <refentry xml:id="arrayiterator.offsetunset" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> @@ -18,9 +18,16 @@ <para> オフセットの値を削除します。 </para> + <para> + 反復処理を実行中の場合、かつ現在の処理のインデックスを削除するために + <methodname>ArrayIterator::offsetUnset</methodname> を使った場合、 + 反復処理の位置は次のインデックスに移動します。 + 反復処理の位置が &foreach; ループの最後であってもインデックスは移動するため、 + <link linkend="control-structures.foreach"><literal>foreach</literal></link> ループの内部で + <methodname>ArrayIterator::offsetUnset</methodname> を使うと、 + 複数のインデックスがスキップされるかもしれません。 + </para> - &warn.undocumented.func; - </refsect1> <refsect1 role="parameters">

« previous php.doc.ja (#5682) next »