3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zones = [ 'Zone Seven: Banana', 'Zone Eight: Banana', 'Zone Four: Cherry', 'Zone Five: Banana', 'Zone Six: Banana', 'Zone One: Apple', 'Zone Two: Orange', 'Zone Three: Avocado', ]; $f = new NumberFormatter("en", NumberFormatter::SPELLOUT); array_multisort( array_map(fn($s) => $f->parse(lcfirst(strstr(substr($s, 5), ':', true))), $zones), $zones ); var_export($zones);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
array ( 0 => 'Zone One: Apple', 1 => 'Zone Two: Orange', 2 => 'Zone Three: Avocado', 3 => 'Zone Four: Cherry', 4 => 'Zone Five: Banana', 5 => 'Zone Six: Banana', 6 => 'Zone Seven: Banana', 7 => 'Zone Eight: Banana', )

preferences:
70.18 ms | 402 KiB | 91 Q