3v4l.org

run code in 500+ PHP versions simultaneously
<?php $oldArr = [ [ "t1" => "test1" ],[ "t2" => "test2" ],[ "t3" => "test3" ],[ "t4" => "test4" ],[ "t5" => "test5" ] ]; $newArr = array_reduce($oldArr, function($carry, $item){ $carry[key($item)] = reset($item); return $carry; }); var_dump($newArr);

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
1543.56 ms | 472 KiB | 20 Q