3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Reman. 9mm Luger 125 gr. Match"; if(preg_match('/(9mm Luger|40 S&W|45 ACP)(.*Match)/',$string,$matches)){ $power_factor = 175; }else{ $power_factor = 0; } $ammunition = "Reman. .380 ACP 195 gr. Target"; $strstart = strcspn($ammunition,"gr"); $substr = substr($ammunition,$strstart-4,4); $grains = filter_var(substr($ammunition,$strstart-4,4),FILTER_SANITIZE_NUMBER_INT); echo '['.$power_factor.'] ['.$strstart.'] ['.$substr.'] ['.$grains.']';

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)
8.3.60.0120.00316.63
8.3.50.0140.00821.22
8.3.40.0120.00318.71
8.3.30.0150.00018.84
8.3.20.0080.00020.33
8.3.10.0000.00721.85
8.3.00.0080.00023.65
8.2.180.0160.00017.00
8.2.170.0140.00322.96
8.2.160.0130.00320.52
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00821.24
8.2.120.0040.00426.35
8.2.110.0000.01019.27
8.2.100.0070.00417.97
8.2.90.0040.00419.11
8.2.80.0000.00817.97
8.2.70.0060.00317.88
8.2.60.0070.00017.93
8.2.50.0060.00318.07
8.2.40.0050.00320.48
8.2.30.0000.00719.52
8.2.20.0050.00317.98
8.2.10.0030.00518.12
8.2.00.0000.00718.23
8.1.280.0090.00625.92
8.1.270.0060.00922.23
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0040.00421.25
8.1.230.0040.00817.52
8.1.220.0040.00417.76
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0030.00617.25
8.1.180.0000.00818.10
8.1.170.0000.00818.63
8.1.160.0040.00420.81
8.1.150.0000.00718.84
8.1.140.0030.00519.68
8.1.130.0000.00817.67
8.1.120.0020.00517.66
8.1.110.0080.00017.65
8.1.100.0000.00817.59
8.1.90.0050.00317.60
8.1.80.0040.00417.65
8.1.70.0070.00017.56
8.1.60.0000.00817.64
8.1.50.0040.00417.69
8.1.40.0080.00317.68
8.1.30.0030.00617.86
8.1.20.0070.00017.82
8.1.10.0000.00717.57
8.1.00.0040.00417.69
8.0.300.0000.00718.77
8.0.290.0080.00017.13
8.0.280.0030.00518.44
8.0.270.0030.00317.30
8.0.260.0040.00417.23
8.0.250.0030.00317.14
8.0.240.0030.00317.15
8.0.230.0030.00317.00
8.0.220.0000.00717.11
8.0.210.0000.00716.94
8.0.200.0030.00317.02
8.0.190.0040.00417.03
8.0.180.0000.00817.07
8.0.170.0020.00517.09
8.0.160.0000.00716.99
8.0.150.0030.00617.08
8.0.140.0040.00416.98
8.0.130.0030.00313.39
8.0.120.0040.00417.04
8.0.110.0000.00716.96
8.0.100.0020.00517.09
8.0.90.0030.00517.01
8.0.80.0030.01217.07
8.0.70.0030.00616.95
8.0.60.0000.00816.93
8.0.50.0050.00217.05
8.0.30.0090.01017.22
8.0.20.0160.00417.40
8.0.10.0020.00517.18
8.0.00.0090.01216.79
7.4.330.0000.00516.80
7.4.320.0000.00716.82
7.4.300.0070.00016.59
7.4.290.0000.00716.75
7.4.280.0040.00416.91
7.4.270.0050.00216.73
7.4.260.0030.00316.70
7.4.250.0000.00716.70
7.4.240.0000.00716.86
7.4.230.0030.00316.77
7.4.220.0110.00816.66
7.4.210.0080.01116.62
7.4.200.0000.00716.78
7.4.160.0110.01116.52
7.4.150.0090.01617.40
7.4.140.0110.00817.86
7.4.130.0040.01416.71
7.4.120.0080.01116.68
7.4.110.0070.01016.50
7.4.100.0030.01416.71
7.4.90.0080.00816.85
7.4.80.0120.00619.39
7.4.70.0060.01216.69
7.4.60.0140.00316.57
7.4.50.0100.00716.57
7.4.40.0130.00316.56
7.4.30.0030.02016.68
7.4.00.0070.01014.99
7.3.330.0030.00313.17
7.3.320.0000.00613.19
7.3.310.0070.00016.42
7.3.300.0000.00716.39
7.3.290.0040.00416.44
7.3.280.0100.00716.45
7.3.270.0130.00917.40
7.3.260.0090.00916.96
7.3.250.0110.00616.68
7.3.240.0050.01216.58
7.3.230.0090.00716.80
7.3.210.0100.00616.63
7.3.200.0130.00519.39
7.3.190.0100.01416.65
7.3.180.0070.01016.35
7.3.170.0080.01516.77
7.3.160.0080.01216.80
7.3.10.0070.00716.80
7.3.00.0030.00817.00
7.2.330.0070.01016.77
7.2.320.0030.01316.66
7.2.310.0060.01816.68
7.2.300.0070.01016.80
7.2.290.0030.01316.79
7.2.130.0070.00716.90
7.2.120.0030.01416.98
7.2.110.0070.01117.23
7.2.100.0030.01016.96
7.2.90.0030.00917.18
7.2.80.0040.00717.13
7.2.70.0040.00717.18
7.2.60.0030.01417.00
7.2.50.0060.00616.92
7.2.40.0060.00616.92
7.2.30.0030.01017.13
7.2.20.0000.01116.91
7.2.10.0090.00316.99
7.2.00.0070.00718.38
7.1.250.0080.00315.97
7.1.100.0000.01218.34
7.1.70.0000.00717.49
7.1.60.0030.02119.28
7.1.50.0100.01317.18
7.1.00.0000.08022.35
7.0.200.0020.00517.07
7.0.60.0170.06721.74
7.0.50.0100.07317.92
7.0.40.0100.07720.44
7.0.30.0270.06320.14
7.0.20.0300.07720.18
7.0.10.0070.06020.21
7.0.00.0070.04020.02
5.6.280.0070.05721.14
5.6.210.0130.07320.76
5.6.200.0100.07318.22
5.6.190.0030.09020.32
5.6.180.0230.03320.29
5.6.170.0200.07720.39
5.6.160.0000.05720.33
5.6.150.0070.06718.07
5.6.140.0070.04018.14
5.6.130.0070.04018.09
5.6.120.0130.08320.90
5.6.110.0100.08021.04
5.6.100.0200.07720.98
5.6.90.0100.08720.98
5.6.80.0030.03720.37
5.5.350.3330.03720.32
5.5.340.0000.07018.02
5.5.330.0100.04320.30
5.5.320.0270.07720.30
5.5.310.0330.06720.33
5.5.300.0000.06018.01
5.5.290.0100.07317.88
5.5.280.0100.07320.96
5.5.270.0070.08320.76
5.5.260.0000.09020.74
5.5.250.0030.07720.71
5.5.240.0100.05320.23

preferences:
31.49 ms | 401 KiB | 5 Q