3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_A = []; $array_B = []; $array_A[0]['name'] = "Robson"; $array_A[0]['value'] = "ROB"; $array_A[1]['name'] = "Morticia"; $array_A[1]['value'] = "MORT"; $array_A[2]['name'] = "John"; $array_A[2]['value'] = "JO"; $array_A[3]['name'] = "Zeke"; $array_A[3]['value'] = "ZE"; $array_B[0] = "Morticia"; $array_B[1] = "Robson"; $array_B[2] = "Zeke"; $array_B[3] = "John"; usort($array_A, function($a, $b) use ($array_B) { return array_search($a['name'], $array_B) > array_search($b['name'], $array_B); }); print_r($array_A);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /in/MJ4TG on line 20 Array ( [0] => Array ( [name] => Morticia [value] => MORT ) [1] => Array ( [name] => Robson [value] => ROB ) [2] => Array ( [name] => Zeke [value] => ZE ) [3] => Array ( [name] => John [value] => JO ) )

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