3v4l.org

run code in 300+ PHP versions simultaneously
<?php function floorDiff(string $input): int { $positiveMatches = preg_match_all ('/\(/', $input); $negativeMatches = preg_match_all ('/\)/', $input); return $positiveMatches + $negativeMatches; } assert(floorDiff('(') === 1); assert(floorDiff(')') === -1); assert(floorDiff('()') === 0); assert(floorDiff('(()))))') === -3);

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.0070.01118.68
8.3.50.0070.01418.26
8.3.40.0150.00018.86
8.3.30.0040.01418.96
8.3.20.0080.00020.03
8.3.10.0040.00423.48
8.3.00.0070.00019.97
8.2.180.0080.00816.88
8.2.170.0060.00922.96
8.2.160.0190.00320.36
8.2.150.0000.01424.18
8.2.140.0000.00824.66
8.2.130.0060.00319.16
8.2.120.0080.00026.35
8.2.110.0030.00621.06
8.2.100.0090.00317.80
8.2.90.0000.00819.09
8.2.80.0040.00417.97
8.2.70.0030.00617.88
8.2.60.0030.00617.80
8.2.50.0030.00518.07
8.2.40.0000.00822.40
8.2.30.0040.00420.54
8.2.20.0040.00417.89
8.2.10.0000.00717.98
8.2.00.0070.00017.97
8.1.280.0060.01225.92
8.1.270.0060.00320.38
8.1.260.0000.00828.09
8.1.250.0030.00528.09
8.1.240.0030.00622.04
8.1.230.0040.00819.09
8.1.220.0000.00817.74
8.1.210.0070.00318.77
8.1.200.0100.00017.47
8.1.190.0040.00417.48
8.1.180.0030.00518.10
8.1.170.0080.00018.71
8.1.160.0000.00720.83
8.1.150.0050.00218.79
8.1.140.0000.00819.60
8.1.130.0030.00517.63
8.1.120.0070.00017.64
8.1.110.0000.00817.56
8.1.100.0040.00417.60
8.1.90.0000.00817.58
8.1.80.0000.00817.63
8.1.70.0070.00017.45
8.1.60.0080.00017.75
8.1.50.0030.00617.60
8.1.40.0040.00417.69
8.1.30.0050.00317.79
8.1.20.0060.00317.77
8.1.10.0040.00417.67
8.1.00.0000.00817.73
8.0.300.0000.00818.77
8.0.290.0060.00316.88
8.0.280.0070.00018.41
8.0.270.0070.00017.20
8.0.260.0030.00317.28
8.0.250.0030.00317.05
8.0.240.0060.00316.99
8.0.230.0000.00716.99
8.0.220.0000.00717.05
8.0.210.0000.00717.08
8.0.200.0000.00617.15
8.0.190.0060.00317.13
8.0.180.0000.00717.11
8.0.170.0090.00017.04
8.0.160.0070.00017.07
8.0.150.0080.00017.08
8.0.140.0040.00416.89
8.0.130.0030.00313.50
8.0.120.0000.00817.02
8.0.110.0040.00416.95
8.0.100.0000.00816.85
8.0.90.0040.00417.01
8.0.80.0060.00917.14
8.0.70.0070.00016.93
8.0.60.0030.00517.06
8.0.50.0040.00417.04
8.0.30.0140.00517.47
8.0.20.0100.00817.42
8.0.10.0080.00017.29
8.0.00.0070.01016.73
7.4.330.0000.00616.82
7.4.320.0000.00716.63
7.4.300.0000.00616.58
7.4.290.0000.00716.74
7.4.280.0040.00416.66
7.4.270.0030.00316.74
7.4.260.0000.00716.82
7.4.250.0040.00416.77
7.4.240.0050.00216.76
7.4.230.0030.00316.81
7.4.220.0130.00316.93
7.4.210.0070.00716.74
7.4.200.0000.00716.48
7.4.160.0120.00316.60
7.4.150.0040.01317.40
7.4.140.0110.01017.86
7.4.130.0070.01216.79
7.4.120.0090.01116.74
7.4.110.0070.01116.65
7.4.100.0100.01316.66
7.4.90.0200.00316.59
7.4.80.0100.01019.39
7.4.70.0170.00416.69
7.4.60.0120.00616.67
7.4.50.0070.01116.66
7.4.40.0180.00316.83
7.4.30.0140.00716.66
7.4.00.0100.00714.90
7.3.330.0060.00013.46
7.3.320.0050.00013.35
7.3.310.0040.00316.54
7.3.300.0000.00716.47
7.3.290.0070.00716.51
7.3.280.0100.00816.53
7.3.270.0110.00817.40
7.3.260.0070.01016.67
7.3.250.0090.01116.65
7.3.240.0070.01316.62
7.3.230.0070.01016.53
7.3.210.0060.01016.89
7.3.200.0070.01516.88
7.3.190.0070.01016.75
7.3.180.0140.00416.74
7.3.170.0090.00616.71
7.3.160.0140.00316.87
7.2.330.0070.01016.58
7.2.320.0140.01016.75
7.2.310.0130.00316.73
7.2.300.0160.00016.77
7.2.290.0070.01016.59
7.2.60.0070.01016.74
7.2.00.0030.00619.79
7.1.200.0000.00915.63
7.1.100.0080.00018.45
7.1.70.0070.00317.33
7.1.60.0030.02019.52
7.1.50.0030.01717.00
7.1.00.0070.07322.59
7.0.200.0030.00516.90
7.0.60.0100.08020.03
7.0.50.0000.04317.76
7.0.40.0070.04020.25
7.0.30.0270.08320.17
7.0.20.0300.07020.24
7.0.10.0070.06320.08
7.0.00.0070.04320.27
5.6.280.0030.07020.86
5.6.210.0130.07720.75
5.6.200.0100.07718.18
5.6.190.0030.04720.48
5.6.180.0530.06020.47
5.6.170.0370.05320.58
5.6.160.0100.05720.43
5.6.150.0000.06018.18
5.6.140.0100.07318.19
5.6.130.0070.08718.15
5.6.120.0070.08720.90
5.6.110.0170.07321.11
5.6.100.0070.08321.11
5.6.90.0000.07321.04
5.6.80.0100.05320.38
5.5.350.0100.04020.38
5.5.340.0070.07017.98
5.5.330.0070.04720.44
5.5.320.0300.04320.30
5.5.310.0230.06020.25
5.5.300.0000.08717.95
5.5.290.0130.07317.98
5.5.280.0070.05720.80
5.5.270.0100.06720.64
5.5.260.0100.08020.64
5.5.250.0130.07720.61
5.5.240.0130.03020.27

preferences:
47.29 ms | 401 KiB | 5 Q