3v4l.org

run code in 300+ PHP versions simultaneously
<?php $books_sorted=array( 0 => array( "title" => "In Search of Lost Time" ), 1 => array( "title" => "Don Quixote" ), 2 => array( "title" => "The Great Gatsby" ) ); $books_available=array( 0 => array( "title" => "Moby Dick" ), 1 => array( "title" => "In Search of Lost Time" ), 2 => array( "title" => "The Great Gatsby" ), 3 => array( "title" => "War and Peace" ) ); $books_sorted_titles = array_column($books_sorted, 'title'); usort($books_available, function($k, $v) use ($books_sorted_titles) { return in_array($v['title'], $books_sorted_titles) ? 1 : -1; }); print_r($books_available);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [title] => In Search of Lost Time ) [1] => Array ( [title] => The Great Gatsby ) [2] => Array ( [title] => Moby Dick ) [3] => Array ( [title] => War and Peace ) )

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