User "Aaron Schulz" posted a comment on MediaWiki.r101244.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/101244#c25309
Commit summary:

Remove more assignments in conditionals (while each to foreach)

Comment:

Using next() in foreach gives wierd results:
<source lang="php">
<?php
$x = array(1,2,3,4,5,6,7,8,9);
foreach( $x as $n => $val ) {
        if ( $val == 6 ) {
                var_dump( $val );
                var_dump( next( $x ) );
                return;
        }
}

</source>

Gives:
<pre>int(6) int(8)</pre>

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to