3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ["name", "address", "city"], ["anoop", "palasis", "Indore"], ["ravinder", "annapurna", "Indore"] ]; var_export( array_map( fn($row) => array_combine($array[0], $row), array_slice($array, 1) ) );
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
array ( 0 => array ( 'name' => 'anoop', 'address' => 'palasis', 'city' => 'Indore', ), 1 => array ( 'name' => 'ravinder', 'address' => 'annapurna', 'city' => 'Indore', ), )

preferences:
60.15 ms | 885 KiB | 4 Q