3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ["name", "address", "city"], ["anoop", "palasis", "Indore"], ["ravinder", "annapurna", "Indore"] ]; array_walk( $array, fn(&$row, $_, $header) => $row = array_combine($header, $row), array_shift($array) ); var_export($array);
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:
47.87 ms | 878 KiB | 4 Q