3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 'Nocciole con guscio 1000gr;;1;€5,50;0;0;No;0;', 'Abbonamento Box Piccola - 4 Box;1;1;€60,00;0;0;Sì;4;', 'Box Media - Mista;2;1;€27,00;0;0;No;0;', 'La Tua Box - Piccola;1;1;€25,00;Mele, Pere;Finocchi, Radicchio Tondo, Cetrioli, Peperoni Rossi;No;0;', 'Abbonamento Box Piccola - 4 Box;1;1;€60,00;0;0;Sì;4;', 'Abbonamento Box Grande - 8 Box;3;1;€200,00;0;0;Sì;8;', 'Box Piccola - Mista;1;1;€20,00;0;0;No;0;', 'Abbonamento Box Media - 4 Box;2;1;€80,00;0;0;Sì;4;' ]; usort($arr, function($a, $b){ $a = (int) explode(';', $a)[1]; $b = (int) explode(';', $b)[1]; if ($a === $b) { return 0; } return ($a < $b) ? 1 : -1; }); var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(8) { [0]=> string(55) "Abbonamento Box Grande - 8 Box;3;1;€200,00;0;0;Sì;8;" [1]=> string(40) "Box Media - Mista;2;1;€27,00;0;0;No;0;" [2]=> string(53) "Abbonamento Box Media - 4 Box;2;1;€80,00;0;0;Sì;4;" [3]=> string(55) "Abbonamento Box Piccola - 4 Box;1;1;€60,00;0;0;Sì;4;" [4]=> string(102) "La Tua Box - Piccola;1;1;€25,00;Mele, Pere;Finocchi, Radicchio Tondo, Cetrioli, Peperoni Rossi;No;0;" [5]=> string(55) "Abbonamento Box Piccola - 4 Box;1;1;€60,00;0;0;Sì;4;" [6]=> string(42) "Box Piccola - Mista;1;1;€20,00;0;0;No;0;" [7]=> string(47) "Nocciole con guscio 1000gr;;1;€5,50;0;0;No;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:
150.81 ms | 407 KiB | 5 Q