3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverse($string) { $substr1 = ""; $substr2 = ""; for ($i = 0; $i < (strlen($string) / 2); $i++) { $substr1 += $string[strlen($string)-$i]; $substr2 += $string[$i]; } return $string = $substr1 + $substr2; } reverse('12345');

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.0060.01518.43
8.3.50.0120.00921.02
8.3.40.0030.01718.74
8.3.30.0030.01019.21
8.3.20.0000.00720.39
8.3.10.0080.00023.65
8.3.00.0040.00419.38
8.2.180.0120.00916.63
8.2.170.0070.01422.96
8.2.160.0100.00320.46
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0050.00222.05
8.2.110.0040.00422.33
8.2.100.0060.00617.75
8.2.90.0040.00419.36
8.2.80.0000.00817.97
8.2.70.0070.00317.75
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0080.00019.88
8.2.30.0000.00718.02
8.2.20.0060.00317.72
8.2.10.0040.00417.98
8.2.00.0040.00417.85
8.1.280.0140.00425.92
8.1.270.0040.00422.02
8.1.260.0030.00526.35
8.1.250.0030.00528.09
8.1.240.0060.00323.92
8.1.230.0000.01117.83
8.1.220.0000.00717.79
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0080.00318.58
8.1.160.0070.00021.95
8.1.150.0040.00418.79
8.1.140.0020.00517.30
8.1.130.0000.00817.94
8.1.120.0000.00717.28
8.1.110.0040.00417.29
8.1.100.0000.00717.46
8.1.90.0000.00717.44
8.1.80.0040.00417.40
8.1.70.0030.00517.42
8.1.60.0090.00017.48
8.1.50.0000.00817.43
8.1.40.0000.00817.41
8.1.30.0030.00517.66
8.1.20.0000.00717.57
8.1.10.0080.00017.45
8.1.00.0000.00817.45
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.52
8.0.270.0030.00317.30
8.0.260.0060.00017.32
8.0.250.0030.00317.02
8.0.240.0030.00317.04
8.0.230.0000.00717.05
8.0.220.0000.00717.00
8.0.210.0000.00716.89
8.0.200.0000.00716.97
8.0.190.0090.00016.95
8.0.180.0040.00416.91
8.0.170.0060.00316.95
8.0.160.0070.00016.92
8.0.150.0040.00416.88
8.0.140.0040.00416.87
8.0.130.0060.00013.32
8.0.120.0000.00716.86
8.0.110.0040.00416.79
8.0.100.0000.00816.93
8.0.90.0070.00016.79
8.0.80.0140.00716.96
8.0.70.0040.00416.89
8.0.60.0000.00716.84
8.0.50.0070.00016.91
8.0.30.0120.00917.11
8.0.20.0120.00817.40
8.0.10.0050.00217.08
8.0.00.0110.00716.64
7.4.330.0030.00315.03
7.4.320.0030.00616.36
7.4.300.0040.00416.59
7.4.290.0000.00716.62
7.4.280.0040.00416.57
7.4.270.0070.00016.63
7.4.260.0030.00316.54
7.4.250.0000.00716.54
7.4.240.0050.00216.56
7.4.230.0030.00316.41
7.4.220.0150.00916.57
7.4.210.0030.01216.58
7.4.200.0000.00716.67
7.4.160.0060.00916.50
7.4.150.0120.00617.40
7.4.140.0110.01117.86
7.4.130.0110.00616.45
7.4.120.0070.01016.58
7.4.110.0070.01816.41
7.4.100.0060.01516.63
7.4.90.0030.01416.63
7.4.80.0140.01119.39
7.4.70.0170.00016.57
7.4.60.0060.01316.51
7.4.50.0030.00516.75
7.4.40.0080.00916.64
7.4.30.0080.00916.53
7.4.00.0110.00714.98
7.3.330.0000.00613.28
7.3.320.0070.00013.43
7.3.310.0020.00516.28
7.3.300.0030.00316.38
7.3.290.0080.00716.46
7.3.280.0090.00816.41
7.3.270.0120.00917.40
7.3.260.0080.00916.39
7.3.250.0050.01116.42
7.3.240.0100.00716.67
7.3.230.0070.01016.50
7.3.210.0070.01016.50
7.3.200.0120.00919.39
7.3.190.0060.01216.49
7.3.180.0090.00616.54
7.3.170.0100.00716.53
7.3.160.0070.01516.38
7.3.120.0090.00914.82
7.3.110.0100.00714.93
7.3.100.0090.00614.91
7.3.90.0090.00314.88
7.3.80.0090.00615.11
7.3.70.0130.00014.61
7.3.60.0110.00414.79
7.3.50.0030.01214.78
7.3.40.0030.01014.46
7.3.30.0030.01014.70
7.3.20.0060.00916.75
7.3.10.0100.00316.37
7.3.00.0090.00316.45
7.2.330.0100.00716.54
7.2.320.0210.00716.61
7.2.310.0030.01416.61
7.2.300.0070.01016.76
7.2.290.0100.01016.71
7.2.250.0150.00415.05
7.2.240.0100.00715.18
7.2.230.0090.00915.27
7.2.220.0070.00715.20
7.2.210.0040.01515.28
7.2.200.0150.00315.08
7.2.190.0070.00715.11
7.2.180.0040.01215.13
7.2.170.0030.01014.90
7.2.130.0100.00316.45
7.2.120.0120.00316.47
7.2.110.0080.00416.73
7.2.100.0050.00916.55
7.2.90.0180.00316.68
7.2.80.0000.01216.80
7.2.70.0100.00716.89
7.2.60.0050.00716.87
7.2.50.0060.00816.59
7.2.40.0100.01416.80
7.2.30.0170.01016.87
7.2.20.0070.01316.60
7.2.10.0150.00616.75
7.2.00.0120.00816.56
7.1.330.0100.00315.53
7.1.320.0030.01015.88
7.1.310.0070.01115.79
7.1.300.0090.00615.68
7.1.290.0070.01015.79
7.1.280.0030.00915.45
7.1.270.0090.00015.87
7.1.260.0030.01415.57
7.1.250.0110.00015.68
7.1.200.0100.00315.82
7.1.70.0110.00416.84
7.1.60.0090.00919.11
7.1.50.0060.01016.80
7.1.00.0000.07722.27
7.0.200.0000.01016.86
7.0.140.0070.07022.09
7.0.60.0100.03319.83
7.0.50.0070.07717.85
7.0.40.0130.05720.23
7.0.30.0230.08320.09
7.0.20.0270.05320.22
7.0.10.0070.04320.10
7.0.00.0100.05020.30
5.6.280.0000.07720.91
5.6.210.0170.07320.66
5.6.200.0070.07018.18
5.6.190.0070.06320.46
5.6.180.0230.03320.46
5.6.170.0200.07720.71
5.6.160.0000.05020.54
5.6.150.0070.06718.15
5.6.140.0130.06318.28
5.6.130.0130.08018.14
5.6.120.0070.08721.12
5.6.110.0000.04321.05
5.6.100.0100.08021.15
5.6.90.0030.04321.01
5.6.80.0030.04320.49
5.6.70.4400.03720.43
5.5.350.0170.07720.53
5.5.340.0030.07317.94
5.5.330.0100.05020.47
5.5.320.0370.04020.30
5.5.310.0230.06320.35
5.5.300.0030.05317.98
5.5.290.0130.07318.04
5.5.280.0030.06720.66
5.5.270.0070.09020.73
5.5.260.0070.08320.64
5.5.250.0130.03020.58
5.5.240.0300.07020.12
5.4.450.0700.05719.36
5.4.440.0600.05719.16
5.4.430.0730.04719.58
5.4.420.0770.06019.42
5.4.410.0470.06319.04
5.4.400.0970.04719.09
5.4.390.0500.06719.24
5.4.380.0670.06019.13
5.4.370.0300.06019.23
5.4.360.0700.05318.86
5.4.350.0270.04019.33
5.4.340.0090.03212.02
5.4.320.0040.04012.50
5.4.310.0070.04012.50
5.4.300.0100.03812.50
5.4.290.0060.03912.50
5.4.280.0090.03412.40
5.4.270.0060.03812.40
5.4.260.0050.04112.40
5.4.250.0080.04412.39
5.4.240.0080.05012.39
5.4.230.0090.04212.39
5.4.220.0070.03712.39
5.4.210.0090.03912.39
5.4.200.0050.04312.39
5.4.190.0080.03612.38
5.4.180.0070.03612.39
5.4.170.0030.04412.39
5.4.160.0020.04012.39
5.4.150.0050.03712.38
5.4.140.0090.03612.07
5.4.130.0070.03612.06
5.4.120.0090.03212.02
5.4.110.0030.04012.01
5.4.100.0030.03912.02
5.4.90.0040.03912.02
5.4.80.0050.03912.01
5.4.70.0100.03612.01
5.4.60.0050.03712.01
5.4.50.0050.03612.01
5.4.40.0100.03012.00
5.4.30.0120.04211.99
5.4.20.0060.04411.99
5.4.10.0050.04611.99
5.4.00.0090.03311.48
5.3.290.0070.04312.80
5.3.280.0060.03812.70
5.3.270.0060.03912.73
5.3.260.0060.04012.72
5.3.250.0100.03412.72
5.3.240.0050.03912.72
5.3.230.0050.03812.71
5.3.220.0040.03912.68
5.3.210.0040.04112.68
5.3.200.0050.03812.68
5.3.190.0050.04412.68
5.3.180.0080.03912.68
5.3.170.0070.03712.67
5.3.160.0070.04112.67
5.3.150.0060.03812.67
5.3.140.0070.03712.66
5.3.130.0080.03812.66
5.3.120.0030.04412.66
5.3.110.0090.04112.66
5.3.100.0080.03812.12
5.3.90.0060.04212.10
5.3.80.0070.03812.09
5.3.70.0070.04112.09
5.3.60.0070.03512.07
5.3.50.0090.03512.02
5.3.40.0100.04312.02
5.3.30.0080.03411.98
5.3.20.0040.03911.76
5.3.10.0090.04811.73
5.3.00.0080.03611.72
5.2.170.0080.0289.21
5.2.160.0070.0319.21
5.2.150.0080.0329.21
5.2.140.0070.0309.21
5.2.130.0080.0309.17
5.2.120.0040.0319.17
5.2.110.0050.0299.18
5.2.100.0020.0339.18
5.2.90.0110.0439.18
5.2.80.0070.0409.16
5.2.70.0050.0319.17
5.2.60.0020.0369.13
5.2.50.0070.0379.09
5.2.40.0070.0369.07
5.2.30.0080.0339.04
5.2.20.0070.0269.04
5.2.10.0050.0278.94
5.2.00.0060.0278.80
5.1.60.0060.0228.08
5.1.50.0050.0238.08
5.1.40.0040.0248.06
5.1.30.0060.0248.42
5.1.20.0030.0308.43
5.1.10.0050.0268.16
5.1.00.0030.0338.16
5.0.50.0030.0226.63
5.0.40.0020.0216.50
5.0.30.0020.0336.31
5.0.20.0050.0186.27
5.0.10.0030.0206.25
5.0.00.0030.0326.25
4.4.90.0050.0134.77
4.4.80.0040.0154.75
4.4.70.0040.0164.76
4.4.60.0040.0164.75
4.4.50.0050.0154.77
4.4.40.0050.0244.71
4.4.30.0030.0164.76
4.4.20.0050.0174.84
4.4.10.0030.0204.85
4.4.00.0040.0294.76
4.3.110.0040.0184.67
4.3.100.0050.0204.66
4.3.90.0010.0174.64
4.3.80.0020.0304.59
4.3.70.0060.0164.63
4.3.60.0000.0244.63
4.3.50.0070.0184.63
4.3.40.0020.0304.54
4.3.30.0040.0153.30
4.3.20.0030.0283.27
4.3.10.0050.0183.24
4.3.00.0200.0137.07

preferences:
44.32 ms | 401 KiB | 5 Q