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); var_dump (floorDiff('(()))))') );

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.40.0070.00719.22
8.3.30.0150.00418.95
8.3.20.0000.00820.30
8.3.10.0000.00823.61
8.3.00.0080.00019.68
8.2.170.0120.00322.96
8.2.160.0060.01220.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00619.27
8.2.120.0050.00326.35
8.2.110.0060.00322.24
8.2.100.0080.00318.04
8.2.90.0040.00419.07
8.2.80.0000.00817.97
8.2.70.0070.00317.88
8.2.60.0050.00218.04
8.2.50.0000.00818.07
8.2.40.0000.00822.11
8.2.30.0000.00720.73
8.2.20.0000.00717.73
8.2.10.0040.00418.04
8.2.00.0040.00418.02
8.1.270.0130.00720.23
8.1.260.0000.00728.09
8.1.250.0110.00728.09
8.1.240.0100.00723.80
8.1.230.0090.00319.21
8.1.220.0000.00817.74
8.1.210.0050.00518.77
8.1.200.0030.00617.48
8.1.190.0050.00317.35
8.1.180.0030.00618.10
8.1.170.0040.00418.55
8.1.160.0040.00420.75
8.1.150.0000.00818.92
8.1.140.0050.00319.56
8.1.130.0000.00717.63
8.1.120.0030.00517.56
8.1.110.0040.00317.44
8.1.100.0040.00417.53
8.1.90.0040.00417.52
8.1.80.0040.00417.51
8.1.70.0040.00417.38
8.1.60.0000.00717.81
8.1.50.0030.00617.74
8.1.40.0040.00417.71
8.1.30.0030.00517.85
8.1.20.0000.00817.72
8.1.10.0040.00417.79
8.1.00.0040.00417.69
8.0.300.0080.00018.77
8.0.290.0020.00516.74
8.0.280.0000.00818.33
8.0.270.0000.00717.16
8.0.260.0080.00017.14
8.0.250.0060.00017.16
8.0.240.0030.00317.02
8.0.230.0030.00317.14
8.0.220.0040.00416.95
8.0.210.0070.00017.09
8.0.200.0060.00017.18
8.0.190.0070.00217.16
8.0.180.0040.00416.99
8.0.170.0080.00017.11
8.0.160.0000.00917.01
8.0.150.0000.00717.00
8.0.140.0040.00416.90
8.0.130.0000.00513.53
8.0.120.0080.00017.05
8.0.110.0000.00816.99
8.0.100.0000.00717.17
8.0.90.0040.00417.12
8.0.80.0060.01217.10
8.0.70.0080.00017.17
8.0.60.0040.00416.84
8.0.50.0040.00416.99
8.0.30.0110.00717.38
8.0.20.0120.00917.44
8.0.10.0040.00417.14
8.0.00.0070.01016.82
7.4.330.0020.00216.80
7.4.320.0030.00316.66
7.4.300.0030.00316.84
7.4.290.0000.00716.87
7.4.280.0050.00216.68
7.4.270.0080.00016.69
7.4.260.0040.00416.73
7.4.250.0000.00716.75
7.4.240.0020.00516.83
7.4.230.0070.00016.73
7.4.220.0030.01516.82
7.4.210.0150.00616.80
7.4.200.0000.00716.83
7.4.160.0100.00616.85
7.4.150.0070.01017.40
7.4.140.0140.00717.86
7.4.130.0090.00916.81
7.4.120.0070.01016.81
7.4.110.0030.01416.79
7.4.100.0130.01016.59
7.4.90.0030.01416.77
7.4.80.0110.01419.39
7.4.70.0100.00716.80
7.4.60.0130.00616.71
7.4.50.0040.01016.76
7.4.40.0060.01516.60
7.4.30.0070.01116.63
7.4.00.0070.00715.16
7.3.330.0000.00713.32
7.3.320.0000.00513.50
7.3.310.0000.00716.32
7.3.300.0000.00716.39
7.3.290.0130.00516.49
7.3.280.0080.01016.48
7.3.270.0110.00717.40
7.3.260.0070.01016.57
7.3.250.0120.00716.60
7.3.240.0140.00316.52
7.3.230.0040.01216.68
7.3.210.0100.00716.67
7.3.200.0160.00616.70
7.3.190.0120.00416.71
7.3.180.0060.01016.75
7.3.170.0070.00816.75
7.3.160.0130.00316.86
7.2.330.0160.00316.89
7.2.320.0150.00816.61
7.2.310.0110.00816.77
7.2.300.0070.01016.73
7.2.290.0120.00616.74
7.2.60.0000.01016.80
7.2.00.0060.00919.59
7.1.200.0040.00715.68
7.1.100.0140.00317.83
7.1.70.0000.00817.42
7.1.60.0100.01319.52
7.1.50.0070.01117.13
7.1.00.0030.07722.45
7.0.200.0030.00616.98
7.0.60.0070.05020.03
7.0.50.0030.04017.90
7.0.40.0070.04020.42
7.0.30.0370.07320.09
7.0.20.0370.07020.09
7.0.10.0000.05320.22
7.0.00.0100.08720.13
5.6.280.0030.07721.04
5.6.210.0130.04720.55
5.6.200.0130.07318.15
5.6.190.0170.07320.47
5.6.180.0200.05320.48
5.6.170.0370.07020.52
5.6.160.0100.04720.41
5.6.150.0070.08718.25
5.6.140.0100.07318.24
5.6.130.0100.08318.14
5.6.120.0070.05321.12
5.6.110.0100.07321.04
5.6.100.0170.07320.96
5.6.90.0100.07721.10
5.6.80.0070.06320.38
5.5.350.0170.07320.52
5.5.340.0030.04018.05
5.5.330.0070.04320.38
5.5.320.0330.04320.34
5.5.310.0170.04320.34
5.5.300.0070.08317.92
5.5.290.0070.05317.95
5.5.280.0000.04720.80
5.5.270.0130.07020.86
5.5.260.0030.06320.84
5.5.250.0100.08720.45
5.5.240.0070.03720.15

preferences:
41.29 ms | 404 KiB | 6 Q