3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ [536870914 => 34213897], [536870914 => 34213905], [536870915 => 34213921], [536870914 => 34213913], [536870915 => 34213929], [536870917 => 34213937], [536870925 => 34218049], ]; $array2 = [ 536870925, 536870914, 536870915, 536870917, ]; usort($array1, function($a, $b) use ($array2) { return array_search(key($a), $array2) <=> array_search(key($b), $array2); }); var_export($array1);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 536870925 => 34218049, ), 1 => array ( 536870914 => 34213897, ), 2 => array ( 536870914 => 34213905, ), 3 => array ( 536870914 => 34213913, ), 4 => array ( 536870915 => 34213921, ), 5 => array ( 536870915 => 34213929, ), 6 => array ( 536870917 => 34213937, ), )

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:
48.34 ms | 402 KiB | 8 Q