3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = array(1,2,3,6,9); //note that 9 does not exist as key in the $values array $values = array('000', '001', '002', '003', '004', '005', '006', '007'); $new = array_map( function( $key) use( $values) { return $values[ $key ]; }, $keys); var_dump( $new);

preferences:
34.47 ms | 402 KiB | 5 Q