How can the values of an array be modified in PHP without using array_walk/map?

To modify the values of an array in PHP without using array_walk/map, you can simply loop through the array using a foreach loop and directly modify the values within the loop.

$array = [1, 2, 3, 4, 5];

foreach ($array as $key => $value) {
    $array[$key] = $value * 2;
}

print_r($array);