3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['name' => 'foo bar bar foo', 'qty' => 6], ['name' => 'bah', 'qty' => 5], ['name' => 'foo foo bar foo', 'qty' => 10], ['name' => 'foo', 'qty' => 6], ['name' => 'foo bar', 'qty' => 6], ['name' => 'bar', 'qty' => 11], ]; usort($array, function($a, $b) { return $b['qty'] <=> $a['qty'] ?: strlen($b['name']) <=> strlen($a['name']); }); var_export(array_column($array, 'qty', 'name'));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'bar' => 11, 'foo foo bar foo' => 10, 'foo bar bar foo' => 6, 'foo bar' => 6, 'foo' => 6, 'bah' => 5, )

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:
29.95 ms | 405 KiB | 5 Q