3v4l.org

run code in 300+ PHP versions simultaneously
<?php $langcodes = [ 'en', 'fr', 'nl', 'cy', 'de', 'hu', 'sv', 'ru', 'ga', 'ko', 'zh', 'ja', ]; $output = array_map(function($langcode) { $f = new \NumberFormatter($langcode, \NumberFormatter::ORDINAL); return implode(' ', array_map(function($i) use ($f) { return $f->format($i); }, array_merge(range(1, 20), range(30, 100, 10)))); }, $langcodes); var_dump(array_combine($langcodes, $output));
Output for 8.1.32, 8.2.27 - 8.2.28, 8.3.5 - 8.3.20, 8.4.2 - 8.4.6
array(12) { ["en"]=> string(131) "1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th 30th 40th 50th 60th 70th 80th 90th 100th" ["fr"]=> string(104) "1er 2e 3e 4e 5e 6e 7e 8e 9e 10e 11e 12e 13e 14e 15e 16e 17e 18e 19e 20e 30e 40e 50e 60e 70e 80e 90e 100e" ["nl"]=> string(103) "1e 2e 3e 4e 5e 6e 7e 8e 9e 10e 11e 12e 13e 14e 15e 16e 17e 18e 19e 20e 30e 40e 50e 60e 70e 80e 90e 100e" ["cy"]=> string(103) "1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 30. 40. 50. 60. 70. 80. 90. 100." ["de"]=> string(103) "1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 30. 40. 50. 60. 70. 80. 90. 100." ["hu"]=> string(103) "1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 30. 40. 50. 60. 70. 80. 90. 100." ["sv"]=> string(131) "1:a 2:a 3:e 4:e 5:e 6:e 7:e 8:e 9:e 10:e 11:e 12:e 13:e 14:e 15:e 16:e 17:e 18:e 19:e 20:e 30:e 40:e 50:e 60:e 70:e 80:e 90:e 100:e" ["ru"]=> string(103) "1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 30. 40. 50. 60. 70. 80. 90. 100." ["ga"]=> string(131) "1ú 2ú 3ú 4ú 5ú 6ú 7ú 8ú 9ú 10ú 11ú 12ú 13ú 14ú 15ú 16ú 17ú 18ú 19ú 20ú 30ú 40ú 50ú 60ú 70ú 80ú 90ú 100ú" ["ko"]=> string(243) "1번째 2번째 3번째 4번째 5번째 6번째 7번째 8번째 9번째 10번째 11번째 12번째 13번째 14번째 15번째 16번째 17번째 18번째 19번째 20번째 30번째 40번째 50번째 60번째 70번째 80번째 90번째 100번째" ["zh"]=> string(159) "第1 第2 第3 第4 第5 第6 第7 第8 第9 第10 第11 第12 第13 第14 第15 第16 第17 第18 第19 第20 第30 第40 第50 第60 第70 第80 第90 第100" ["ja"]=> string(159) "第1 第2 第3 第4 第5 第6 第7 第8 第9 第10 第11 第12 第13 第14 第15 第16 第17 第18 第19 第20 第30 第40 第50 第60 第70 第80 第90 第100" }

preferences:
51.42 ms | 412 KiB | 5 Q