3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = [ 'success' => 1, 'return' => [ 'sellorders' => [ [ 'sellprice' => 0.00000059, 'quantity' => 1076.00000000, 'total' => 0.00063484, ], [ 'sellprice' => 0.00000060, 'quantity' => 927.41519000, 'total' => 0.00055645, ], ], 'buyorders' => [ [ 'buyprice' => 0.00000058, 'quantity' => 6535.77328102, 'total' => 0.00379075, ], [ 'buyprice' => 0.00000057, 'quantity' => 118539.39620414, 'total' => 0.06756746, ], ], ], ]; $result = []; foreach ($response['return'] as $orders) { foreach ($orders as $item) { $result[] = [ 'sellprice' => $item['sellprice'] ?? $item['buyprice'], 'sellquantity' => $item['quantity'], 'selltotal' => $item['total'], ]; } } var_export($result);
Output for git.master_jit, git.master
array ( 0 => array ( 'sellprice' => 5.9E-7, 'sellquantity' => 1076.0, 'selltotal' => 0.00063484, ), 1 => array ( 'sellprice' => 6.0E-7, 'sellquantity' => 927.41519, 'selltotal' => 0.00055645, ), 2 => array ( 'sellprice' => 5.8E-7, 'sellquantity' => 6535.77328102, 'selltotal' => 0.00379075, ), 3 => array ( 'sellprice' => 5.7E-7, 'sellquantity' => 118539.39620414, 'selltotal' => 0.06756746, ), )

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:
65.72 ms | 406 KiB | 5 Q