3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ [ 'FirstName' => 'Pim', 'Address' => 'Finland', 'LastName' => 'Svensson', 'ID' => 3 ], [ 'FirstName' => 'Emil', 'Address' => 'Sweden', 'LastName' => 'Malm', 'ID' => 5 ] ]; $order = ['ID', 'FirstName', 'LastName', 'Address']; var_export( array_map( function ($row) use ($order) { static $keys = array_flip($order); return array_replace($keys, $row); }, $rows ) );
Output for git.master_jit, git.master
array ( 0 => array ( 'ID' => 3, 'FirstName' => 'Pim', 'LastName' => 'Svensson', 'Address' => 'Finland', ), 1 => array ( 'ID' => 5, 'FirstName' => 'Emil', 'LastName' => 'Malm', 'Address' => 'Sweden', ), )

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