What are some alternatives to using array_walk/map to modify the values of an array in PHP?

When you want to modify the values of an array in PHP without using array_walk/map, you can iterate over the array using a foreach loop and directly modify the values within the loop. This approach can be more straightforward and easier to understand compared to using array_walk/map functions.

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

// Modify array values using foreach loop
foreach ($numbers as $key => $value) {
    $numbers[$key] = $value * 2;
}

// Output modified array
print_r($numbers);