3v4l.org

run code in 300+ PHP versions simultaneously
<?php $argv[1] = '-0000100.123400000'; echo '-'==($_=$argv[1])[0]?$n=$_=trim($_,'-'):$_,0); exit; error_reporting(0); function x($v){ $argv[1] = $v; echo strlen((explode('.',$t=trim('-'==($_=$argv[1])[0]?$n=$_=trim($_,'-'):$_,0)))[1]).($t!==$_?($n?' -':' ').('.'==$t[0]?0:'').trim($t,'.'):''); echo "\n"; } x('-12.32'); x('32'); x('3231.432'); x('-34.0'); x('023'); x('00324.230'); x('10'); x('00.3'); x('0'); x('-0'); x('-0.0'); x('-04.8330'); x('-000000000012345678901234567890000.000012345678901234567890000');

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.0.20.0230.03720.23
7.0.10.0030.09020.23
7.0.00.0070.07020.16
5.6.170.0370.07720.48
5.6.160.0130.07720.62
5.6.150.0070.07318.23
5.6.140.0070.07718.21
5.6.130.0070.03718.27
5.6.120.0070.08720.89
5.6.110.0100.08020.99
5.6.100.0170.08021.03
5.6.90.0100.08321.01
5.6.80.0070.04020.53
5.5.310.0430.06320.36
5.5.300.0070.03717.98
5.5.290.0070.08318.09
5.5.280.0200.07320.76
5.5.270.0000.08320.87
5.5.260.0100.08320.76
5.5.250.0000.08020.54
5.5.240.0270.07320.18

preferences:
132.81 ms | 1394 KiB | 7 Q