$x = array('a' => 1, 'b' => 2); foreach($x as &$val) { $val += 1; } while($x) { $val = array_shift($x); print "Val: $val\n"; }