3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ 12 => "USD", 13 => "10150.00", 14 => "9850.00", 15 => "SGD", 16 => "8015.40", 17 => "7915.40", 18 => "HKD", 19 => "1304.60", 20 => "1288.60" ]; var_export( array_reduce( array_chunk($input, 3), function($carry, $item) { $carry[$item[0]] = ["Buy" => $item[1], "Sell" => $item[2]]; return $carry; }, [] ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'USD' => array ( 'Buy' => '10150.00', 'Sell' => '9850.00', ), 'SGD' => array ( 'Buy' => '8015.40', 'Sell' => '7915.40', ), 'HKD' => array ( 'Buy' => '1304.60', 'Sell' => '1288.60', ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
116.51 ms | 406 KiB | 5 Q