3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allOptions = [ ["clID" => 171], ["clID" => 191], ["clID" => 131], ["clID" => 101], ["clID" => 201], ["clID" => 181], ["clID" => 99], // not in regOptions ["clID" => 129], // not in regOptions ["clID" => 139], ]; $regOptions = [ ["order" => 1, "optID" => 131], ["order" => 2, "optID" => 191], ["order" => 3, "optID" => 181], ["order" => 4, "optID" => 139], ["order" => 5, "optID" => 101], ["order" => 6, "optID" => 201], ["order" => 7, "optID" => 171], ]; $priority = array_column($regOptions, 'order', 'optID'); array_multisort( array_map(fn($v) => $priority[$v['clID']] ?? PHP_INT_MAX, $allOptions), $allOptions ); var_export($allOptions);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'clID' => 131, ), 1 => array ( 'clID' => 191, ), 2 => array ( 'clID' => 181, ), 3 => array ( 'clID' => 139, ), 4 => array ( 'clID' => 101, ), 5 => array ( 'clID' => 201, ), 6 => array ( 'clID' => 171, ), 7 => array ( 'clID' => 99, ), 8 => array ( 'clID' => 129, ), )

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