3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attribute_content[0]['term_id'] = 76; $attribute_content[0]['content'] = "ratio"; $attribute_content[1]['term_id'] = 18; $attribute_content[1]['content'] = "ideal condition"; $attribute_content[2]['term_id'] = 164; $attribute_content[2]['content'] = "genotype"; $attribute_content[3]['term_id'] = 218; $attribute_content[3]['content'] = "genetics"; $attribute_content[4]['term_id'] = 60; $attribute_content[4]['content'] = "height"; $order = array(18,164,218,60,76); $weights = array_flip($order); usort($attribute_content, function($x, $y) use($weights) { return $weights[$x['term_id']] - $weights[$y['term_id']]; }); var_dump($attribute_content);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> array(2) { ["term_id"]=> int(18) ["content"]=> string(15) "ideal condition" } [1]=> array(2) { ["term_id"]=> int(164) ["content"]=> string(8) "genotype" } [2]=> array(2) { ["term_id"]=> int(218) ["content"]=> string(8) "genetics" } [3]=> array(2) { ["term_id"]=> int(60) ["content"]=> string(6) "height" } [4]=> array(2) { ["term_id"]=> int(76) ["content"]=> string(5) "ratio" } }

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:
39.18 ms | 407 KiB | 5 Q