3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ ['id' => 0, 'name' => '10sdf'], ['id' => 0, 'name' => '12'], ['id' => 0, 'name' => 'aasdfbc'], ['id' => 0, 'name' => 'ada'], ['id' => 0, 'name' => 'asdfsdf'], ]; //排序 usort($arr, function ($a, $b) { if (strlen($a['name']) == strlen($b['name'])) return 0; return strlen($a['name']) < strlen($b['name']) ? -1 : 1; }); //修改key $arr1 = []; array_walk($arr, function ($v,$k) use ($arr1){ $arr1[$k+1] = $v; }); var_dump($arr1);
Output for git.master, git.master_jit, rfc.property-hooks
array(0) { }

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:
50.88 ms | 401 KiB | 8 Q