3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 20.001; $formatter = new NumberFormatter(Locale::getDefault(), NumberFormatter::CURRENCY); $formatter->setSymbol(NumberFormatter::CURRENCY_SYMBOL, ''); echo $formatter->format($value, NumberFormatter::TYPE_DOUBLE)
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17, 7.0.0 - 7.0.2
Parse error: syntax error, unexpected end of file, expecting ',' or ';' in /in/D1A6A on line 5
Process exited with code 255.

preferences:
271.81 ms | 1400 KiB | 29 Q