<?php $test1 = $test2 = ['foo', 'bar']; foreach ($test1 as &$v) { $v = ['name' => $v]; } foreach ($test2 ?? [] as &$v) { $v = ['name' => $v]; } print_r($test1); print_r($test2);
You have javascript disabled. You will not be able to edit any code.