3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertPriceToPoints(string $price, $unit = 1) { $priceAsDigits = preg_replace("", /[^0-9]/g, $price); return $priceAsDigits; } echo convertPriceToPoints("R$ 19,90");
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
Parse error: syntax error, unexpected '/' in /in/J9AEo on line 4
Process exited with code 255.

preferences:
180.4 ms | 1395 KiB | 36 Q