3v4l.org

run code in 500+ PHP versions simultaneously
<?php $price = "one price $1,234,567.223 and some other price $60"; preg_match_all('/([\d\.,]+)/',$price,$match); Var_dump($match); $formatter = new NumberFormatter('en_US', NumberFormatter::CURRENCY); Var_export($formatter->parseCurrency($price, $curr));
Output for 8.0.13, 8.5.1 - 8.5.3
array(2) { [0]=> array(2) { [0]=> string(13) "1,234,567.223" [1]=> string(2) "60" } [1]=> array(2) { [0]=> string(13) "1,234,567.223" [1]=> string(2) "60" } } Fatal error: Uncaught Error: Class "NumberFormatter" not found in /in/ejmfj:8 Stack trace: #0 {main} thrown in /in/ejmfj on line 8
Process exited with code 255.
Output for 5.6.38, 7.1.0 - 7.1.23, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 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.18, 8.5.0
array(2) { [0]=> array(2) { [0]=> string(13) "1,234,567.223" [1]=> string(2) "60" } [1]=> array(2) { [0]=> string(13) "1,234,567.223" [1]=> string(2) "60" } } false
Output for 7.3.32 - 7.3.33, 7.4.33
array(2) { [0]=> array(2) { [0]=> string(13) "1,234,567.223" [1]=> string(2) "60" } [1]=> array(2) { [0]=> string(13) "1,234,567.223" [1]=> string(2) "60" } } Fatal error: Uncaught Error: Class 'NumberFormatter' not found in /in/ejmfj:8 Stack trace: #0 {main} thrown in /in/ejmfj on line 8
Process exited with code 255.

preferences:
110.13 ms | 1491 KiB | 4 Q