3v4l.org

run code in 500+ PHP versions simultaneously
<?php function multi_reset(&...$arrays) { foreach ($arrays as &$array) { reset($array); } } $a = $b = $c = [1, 2, 3]; next($a); next($b); next($b); echo 'Before multi_reset(): ' . current($a) . ' ' . current($b) . ' ' . current($c) . "\n"; multi_reset($a, $b, $c); echo 'After multi_reset(): ' . current($a) . ' ' . current($b) . ' ' . current($c) . "\n";

preferences:
20.77 ms | 476 KiB | 4 Q