3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function($errno, $errstr) { $bt = debug_backtrace(); var_dump($errstr); }); $input = array( 'first' => array(), 'second' => array('position' => 2), array('something' => 5), NULL => array('error' => 1), ); $displays = array(); foreach ($input as $key => $options) { $options += array( 'display_options' => array(), 'display_plugin' => NULL, 'id' => NULL, 'display_title' => '', 'position' => NULL, ); // Add the defaults for the display. $displays[$key] = $options; } uasort($displays, function ($display1, $display2) { if ($display1['position'] != $display2['position']) { return $display1['position'] < $display2['position'] ? -1 : 1; } return 0; }); print_r($displays);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [first] => Array ( [display_options] => Array ( ) [display_plugin] => [id] => [display_title] => [position] => ) [0] => Array ( [something] => 5 [display_options] => Array ( ) [display_plugin] => [id] => [display_title] => [position] => ) [] => Array ( [error] => 1 [display_options] => Array ( ) [display_plugin] => [id] => [display_title] => [position] => ) [second] => Array ( [position] => 2 [display_options] => Array ( ) [display_plugin] => [id] => [display_title] => ) )

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:
49.61 ms | 403 KiB | 8 Q