3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverse($string) { $substr1 = ""; $substr2 = ""; $strLength = strlen($string); $strLengthHalf = round(strlen($string) / 2); for ($i = 0; $i <= $strLengthHalf -$i; $i++) { $substr1 .= $string[$strLength-$i]; $substr2 .= $string[$strLengthHalf - $i]; } var_dump($substr1); var_dump($substr2); return $string = $substr1.$substr2; } var_dump(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.00918.54
8.3.50.0130.01021.98
8.3.40.0180.00419.09
8.3.30.0070.00719.04
8.3.20.0040.00420.33
8.3.10.0120.00623.50
8.3.00.0030.00619.50
8.2.180.0180.00316.88
8.2.170.0120.00622.96
8.2.160.0120.00820.47
8.2.150.0160.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00422.23
8.2.110.0030.00622.11
8.2.100.0110.00017.88
8.2.90.0080.00019.14
8.2.80.0090.00017.97
8.2.70.0030.00517.63
8.2.60.0070.00318.16
8.2.50.0030.00618.07
8.2.40.0030.00620.13
8.2.30.0000.00818.24
8.2.20.0050.00217.79
8.2.10.0000.00718.23
8.2.00.0000.00717.79
8.1.280.0070.01325.92
8.1.270.0090.00022.20
8.1.260.0050.00326.35
8.1.250.0140.00328.09
8.1.240.0040.00423.80
8.1.230.0080.00419.15
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0000.00817.11
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0040.00418.50
8.1.160.0040.00422.05
8.1.150.0040.00418.80
8.1.140.0000.00717.32
8.1.130.0000.00717.92
8.1.120.0000.00717.40
8.1.110.0040.00417.45
8.1.100.0070.00017.44
8.1.90.0070.00017.34
8.1.80.0070.00017.35
8.1.70.0000.00717.36
8.1.60.0030.00617.53
8.1.50.0050.00317.60
8.1.40.0040.00417.58
8.1.30.0050.00317.61
8.1.20.0030.00517.70
8.1.10.0030.00517.64
8.1.00.0090.00017.48
8.0.300.0000.00718.77
8.0.290.0080.00016.88
8.0.280.0000.00818.54
8.0.270.0030.00317.29
8.0.260.0030.00317.43
8.0.250.0070.00017.08
8.0.240.0030.00317.04
8.0.230.0040.00416.93
8.0.220.0000.00616.98
8.0.210.0080.00017.00
8.0.200.0030.00316.96
8.0.190.0060.00317.13
8.0.180.0040.00417.05
8.0.170.0080.00016.93
8.0.160.0000.00716.96
8.0.150.0000.00716.84
8.0.140.0000.00716.80
8.0.130.0050.00013.50
8.0.120.0000.00817.04
8.0.110.0030.00516.97
8.0.100.0040.00416.92
8.0.90.0040.00417.07
8.0.80.0090.00817.01
8.0.70.0040.00416.89
8.0.60.0000.00817.11
8.0.50.0040.00417.04
8.0.30.0130.00917.29
8.0.20.0130.00717.44
8.0.10.0000.00816.87
8.0.00.0130.00616.88
7.4.330.0020.00215.13
7.4.320.0000.00816.63
7.4.300.0000.00616.61
7.4.290.0070.00016.48
7.4.280.0030.00316.65
7.4.270.0000.00816.56
7.4.260.0000.00716.66
7.4.250.0040.00316.67
7.4.240.0020.00516.67
7.4.230.0050.00216.71
7.4.220.0060.01116.61
7.4.210.0040.01116.72
7.4.200.0000.00716.57
7.4.160.0110.00416.61
7.4.150.0170.00917.40
7.4.140.0140.02317.86
7.4.130.0080.01116.68
7.4.120.0040.01416.63
7.4.110.0160.00616.44
7.4.100.0090.00616.50
7.4.90.0080.00816.71
7.4.80.0130.00919.39
7.4.70.0040.01316.57
7.4.60.0030.01416.54
7.4.50.0020.00216.45
7.4.40.0090.00616.63
7.4.30.0080.00816.64
7.4.00.0100.00715.17
7.3.330.0060.00013.23
7.3.320.0030.00313.42
7.3.310.0030.00316.35
7.3.300.0000.00716.50
7.3.290.0120.00716.47
7.3.280.0090.01016.49
7.3.270.0120.01217.40
7.3.260.0160.00616.40
7.3.250.0120.00516.57
7.3.240.0110.00716.64
7.3.230.0130.00916.44
7.3.210.0130.00516.61
7.3.200.0110.00619.39
7.3.190.0070.01016.54
7.3.180.0100.00616.57
7.3.170.0060.01116.50
7.3.160.0140.00316.53
7.3.120.0100.01014.58
7.3.110.0110.00614.68
7.3.100.0070.01014.61
7.3.90.0040.01114.82
7.3.80.0000.01214.89
7.3.70.0040.01114.85
7.3.60.0040.01114.99
7.3.50.0130.00314.87
7.3.40.0070.01014.82
7.3.30.0100.00314.95
7.3.20.0030.01216.71
7.3.10.0050.00716.68
7.3.00.0050.00716.74
7.2.330.0090.00916.80
7.2.320.0180.00616.88
7.2.310.0080.00816.71
7.2.300.0110.00716.73
7.2.290.0060.01616.69
7.2.250.0130.00014.96
7.2.240.0100.00715.27
7.2.230.0060.00614.87
7.2.220.0090.00314.99
7.2.210.0140.00014.85
7.2.200.0110.01114.99
7.2.190.0040.00715.05
7.2.180.0090.00415.00
7.2.170.0030.00615.09
7.2.130.0030.01216.83
7.2.120.0090.00516.89
7.2.110.0010.01116.87
7.2.100.0050.00817.01
7.2.90.0100.00316.90
7.2.80.0060.01016.71
7.2.70.0020.01116.81
7.2.60.0080.00717.01
7.2.50.0050.01116.88
7.2.40.0050.00817.03
7.2.30.0100.00216.92
7.2.20.0040.01217.13
7.2.10.0010.00916.98
7.2.00.0050.00817.74
7.1.330.0030.01015.94
7.1.320.0000.01515.61
7.1.310.0130.00015.77
7.1.300.0070.00715.84
7.1.290.0040.00415.95
7.1.280.0040.00715.98
7.1.270.0090.00615.87
7.1.260.0090.00315.82
7.1.250.0050.00615.87
7.1.100.0030.01018.29
7.1.70.0030.00517.32
7.1.60.0160.00919.11
7.1.50.0140.01016.95
7.1.00.0000.07322.31
7.0.200.0090.00016.66
7.0.140.0000.07021.95
7.0.60.0030.08020.02
7.0.50.0170.07317.84
7.0.40.0130.08320.03
7.0.30.0270.05320.26
7.0.20.0470.06320.07
7.0.10.0100.05320.23
7.0.00.0030.04320.25
5.6.280.0070.07020.87
5.6.210.0030.08020.62
5.6.200.0070.06718.22
5.6.190.0170.08320.46
5.6.180.0300.07320.56
5.6.170.0230.05020.61
5.6.160.0100.07720.54
5.6.150.0130.07318.12
5.6.140.0070.08318.28
5.6.130.0070.08718.23
5.6.120.0030.09021.14
5.6.110.0230.07321.11
5.6.100.0130.08021.14
5.6.90.0130.08321.02
5.6.80.0030.04020.36
5.5.350.4000.04020.50
5.5.340.0070.04717.98
5.5.330.0070.07320.27
5.5.320.0300.07320.48
5.5.310.0330.06720.25
5.5.300.0000.05017.98
5.5.290.0170.05317.97
5.5.280.0030.08320.95
5.5.270.0070.08020.71
5.5.260.0170.07320.96
5.5.250.0130.06720.60
5.5.240.0130.05720.18
5.4.450.0830.05319.48
5.4.440.0670.08319.62
5.4.430.0630.05719.47
5.4.420.0830.05719.58
5.4.410.0870.06319.48
5.4.400.0900.06719.32
5.4.390.0600.07019.26
5.4.380.0700.06319.35
5.4.370.0730.06319.35
5.4.360.0570.07019.28
5.4.350.0430.05719.32
5.4.340.0050.03612.01
5.4.320.0050.03912.50
5.4.310.0050.04012.50
5.4.300.0080.04112.50
5.4.290.0080.04212.50
5.4.280.0100.04512.40
5.4.270.0090.03512.40
5.4.260.0030.04512.40
5.4.250.0080.05212.40
5.4.240.0100.03812.39
5.4.230.0100.04112.39
5.4.220.0050.04112.39
5.4.210.0040.03712.39
5.4.200.0030.04012.39
5.4.190.0040.04012.39
5.4.180.0060.04812.39
5.4.170.0100.04912.39
5.4.160.0140.04512.39
5.4.150.0050.04212.39
5.4.140.0040.04012.07
5.4.130.0050.03712.06
5.4.120.0080.03412.02
5.4.110.0060.03612.02
5.4.100.0060.03612.01
5.4.90.0070.03612.01
5.4.80.0070.03712.02
5.4.70.0060.03612.01
5.4.60.0040.03712.00
5.4.50.0070.03812.01
5.4.40.0120.04912.00
5.4.30.0100.04111.99
5.4.20.0080.03511.99
5.4.10.0100.03811.99
5.4.00.0060.03711.49
5.3.290.0050.04212.80
5.3.280.0050.04412.71
5.3.270.0070.03912.72
5.3.260.0070.03912.71
5.3.250.0080.04112.72
5.3.240.0060.04012.72
5.3.230.0090.04312.71
5.3.220.0070.04112.68
5.3.210.0050.04112.68
5.3.200.0120.03212.68
5.3.190.0030.04312.68
5.3.180.0060.03912.67
5.3.170.0090.03712.66
5.3.160.0050.04012.67
5.3.150.0090.03812.67
5.3.140.0100.03512.66
5.3.130.0080.04012.65
5.3.120.0050.04312.66
5.3.110.0050.05112.66
5.3.100.0060.03912.12
5.3.90.0060.03912.11
5.3.80.0080.04512.09
5.3.70.0060.04312.09
5.3.60.0060.03612.08
5.3.50.0080.03412.02
5.3.40.0090.03312.02
5.3.30.0080.03911.98
5.3.20.0090.03411.76
5.3.10.0030.03911.73
5.3.00.0070.03811.71
5.2.170.0040.0329.23
5.2.160.0050.0299.23
5.2.150.0100.0369.23
5.2.140.0090.0389.23
5.2.130.0100.0409.19
5.2.120.0100.0299.19
5.2.110.0070.0279.20
5.2.100.0020.0449.20
5.2.90.0040.0439.19
5.2.80.0080.0289.19
5.2.70.0080.0369.19
5.2.60.0040.0439.14
5.2.50.0100.0379.11
5.2.40.0050.0309.09
5.2.30.0070.0369.07
5.2.20.0050.0339.06
5.2.10.0050.0338.96
5.2.00.0030.0308.82
5.1.60.0050.0238.10
5.1.50.0040.0258.10
5.1.40.0050.0248.08
5.1.30.0060.0258.43
5.1.20.0040.0278.45
5.1.10.0030.0278.18
5.1.00.0040.0278.18
5.0.50.0030.0226.66
5.0.40.0060.0176.52
5.0.30.0010.0356.33
5.0.20.0030.0206.30
5.0.10.0020.0226.28
5.0.00.0050.0296.27
4.4.90.0050.0134.78
4.4.80.0040.0144.75
4.4.70.0030.0154.76
4.4.60.0030.0154.76
4.4.50.0070.0284.77
4.4.40.0030.0294.71
4.4.30.0020.0164.76
4.4.20.0040.0144.85
4.4.10.0030.0154.84
4.4.00.0040.0234.76
4.3.110.0020.0164.67
4.3.100.0030.0144.66
4.3.90.0030.0154.63
4.3.80.0030.0244.58
4.3.70.0030.0144.63
4.3.60.0040.0144.63
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0020.0163.32
4.3.20.0030.0163.29
4.3.10.0030.0153.26
4.3.00.0100.0276.85

preferences:
54.8 ms | 401 KiB | 5 Q