1--TEST-- 2sort() functions precerve foreach by reference iterator pointer 3--FILE-- 4<?php 5$a = [1,2,3,4,5,0]; 6foreach($a as &$v) { 7 echo "$v\n"; 8 if ($v == 3) { 9 rsort($a); 10 } 11} 12?> 13--EXPECT-- 141 152 163 172 181 190 20