3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = ['key1','value1','key2','value2']; //$output=['key1'=>'value1','key2'=>'value2']; $output=[]; do { $output[current($input)] = next($input); } while (next($input)); print_r($output);

preferences:
32.11 ms | 406 KiB | 5 Q