3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fooList = [10, 20, 30, 40, 50, 60]; $barList = []; foreach ($fooList as $fooItem) { $barList[] = &$fooItem; } var_dump($fooList); var_dump($barList);

preferences:
48.81 ms | 402 KiB | 5 Q