3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ '152.15 x 12.34 x 11mm', '152.15x12.34x11 mm', '152.15mmx12.34mm x 11mm', ]; foreach ($tests as $test) { var_dump( sscanf($test, '%f%*[mx ]%f%*[mx ]%f') ); echo "\n"; }
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
array(3) { [0]=> float(152.15) [1]=> float(12.34) [2]=> float(11) } array(3) { [0]=> float(152.15) [1]=> float(12.34) [2]=> float(11) } array(3) { [0]=> float(152.15) [1]=> float(12.34) [2]=> float(11) }
Output for 4.3.0
Parse error: parse error, unexpected '[' in /in/focug on line 3
Process exited with code 255.

preferences:
112.26 ms | 401 KiB | 122 Q