3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c = new Collator("en_US"); // should work with any locale $a = ["02#aa", "02#ab", "03#a", "02#a", "03#x", "03#b", "03#ba", "03#b", "04#a", "03#f"]; echo 'collator sort:' . PHP_EOL; $c->sort($a, Collator::SORT_STRING); // SORT_REGULAR produces same result var_dump($a); echo 'expected results:' . PHP_EOL; sort($a, SORT_STRING); var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
collator sort: array(10) { [0]=> string(4) "02#a" [1]=> string(5) "02#aa" [2]=> string(5) "02#ab" [3]=> string(4) "03#a" [4]=> string(4) "03#b" [5]=> string(4) "03#b" [6]=> string(5) "03#ba" [7]=> string(4) "03#f" [8]=> string(4) "03#x" [9]=> string(4) "04#a" } expected results: array(10) { [0]=> string(4) "02#a" [1]=> string(5) "02#aa" [2]=> string(5) "02#ab" [3]=> string(4) "03#a" [4]=> string(4) "03#b" [5]=> string(4) "03#b" [6]=> string(5) "03#ba" [7]=> string(4) "03#f" [8]=> string(4) "03#x" [9]=> string(4) "04#a" }

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:
62.75 ms | 402 KiB | 8 Q