3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ "€1000", "€66.66", "€-5.0005", ]; $result = []; foreach ($tests as $t) { sscanf($t, '€%d', $result["$t: asInteger"]); sscanf($t, '€%f', $result["$t: asFloat"]); } var_dump($result);
Output for 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 - 8.5.3
array(6) { ["€1000: asInteger"]=> int(1000) ["€1000: asFloat"]=> float(1000) ["€66.66: asInteger"]=> int(66) ["€66.66: asFloat"]=> float(66.66) ["€-5.0005: asInteger"]=> int(-5) ["€-5.0005: asFloat"]=> float(-5.0005) }

preferences:
72.11 ms | 1014 KiB | 4 Q