for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Lneicelis\Transformer\Helper;
class Arr
{
public static function setValue(array $array, array $path, $value): array
$lastKey = array_pop($path);
$current = &$array;
foreach($path as $key) {
$current = &$current[$key];
}
$current[$lastKey] = $value;
return $array;