I assume that it was PHP 3, which did not support foreach , and was retained in later versions for compatibility. For instance:
for(;$x=each($myArray),$key=$x['key'],$value=$x['value'];) { // do something }
It will be closest to the foreach .
Ryan source share