3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['one', 'two', 'three', 'four',]; $temp = $arr; foreach($arr as $v){ $temp[$v] = $arr; } print_r($arr); print_r($temp);

preferences:
52.73 ms | 402 KiB | 5 Q