3v4l.org

run code in 500+ PHP versions simultaneously
<?php $f = new NumberFormatter('en-US', NumberFormatter::DECIMAL); $f->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 2); $f->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 999); echo $f->format("1000000") . PHP_EOL; echo $f->format("1000000.6") . PHP_EOL; echo $f->format("1000000.63") . PHP_EOL; echo $f->format("1000000.68464") . PHP_EOL;
Output for 8.5.1 - 8.5.7
Fatal error: Uncaught Error: Class "NumberFormatter" not found in /in/filso:3 Stack trace: #0 {main} thrown in /in/filso on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.32, 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0
1,000,000.00 1,000,000.60 1,000,000.63 1,000,000.68464
Output for 7.4.33
Fatal error: Uncaught Error: Class 'NumberFormatter' not found in /in/filso:3 Stack trace: #0 {main} thrown in /in/filso on line 3
Process exited with code 255.

preferences:
89.03 ms | 1257 KiB | 4 Q