3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = ['a'=>'apple', 'b'=>'banana', 'c'=>'pear']; $new = []; foreach($ar as $k => $v){ $new[] = ['phrase' => $k, 'fruit' => $v]; } print_r($new); ?>

preferences:
62.89 ms | 404 KiB | 5 Q