3v4l.org

run code in 500+ PHP versions simultaneously
<?php foreach (['tr_TR', 'en_US', 'ar_SA', 'ar-u-nu-latn'] as $locale) { $numberFormatter = new NumberFormatter($locale, NumberFormatter::PERCENT); echo "$locale: 0.7 => " . $numberFormatter->format(0.7) . PHP_EOL; }
Output for 8.5.1 - 8.5.3
Fatal error: Uncaught Error: Class "NumberFormatter" not found in /in/7ksVG:4 Stack trace: #0 {main} thrown in /in/7ksVG on line 4
Process exited with code 255.
Output for 8.1.34, 8.2.18 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0
tr_TR: 0.7 => %70 en_US: 0.7 => 70% ar_SA: 0.7 => ٧٠٪؜ ar-u-nu-latn: 0.7 => 70‎%‎
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
tr_TR: 0.7 => %70 en_US: 0.7 => 70% ar_SA: 0.7 => ٧٠٪ ar-u-nu-latn: 0.7 => 70٪

preferences:
57.31 ms | 841 KiB | 4 Q