3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverse($string) { $substr1 = ""; $substr2 = ""; $strLength = strlen($string)-1; for ($i = 0; $i < ($strLength / 2); $i++) { $substr1 += $string[$strLength-$i]; $substr2 += $string[$i]; } 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.40.0110.00718.70
8.3.30.0030.01019.04
8.3.20.0000.00820.21
8.3.10.0000.00823.53
8.3.00.0030.00519.38
8.2.170.0120.00322.96
8.2.160.0100.00320.39
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00021.95
8.2.110.0030.00620.34
8.2.100.0080.00318.16
8.2.90.0050.00319.14
8.2.80.0000.00817.97
8.2.70.0040.00417.61
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0000.00919.81
8.2.30.0040.00418.09
8.2.20.0030.00617.87
8.2.10.0000.00718.03
8.2.00.0000.00817.79
8.1.270.0140.00322.14
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00323.72
8.1.230.0080.00319.04
8.1.220.0070.00017.79
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0080.00018.55
8.1.160.0040.00422.02
8.1.150.0000.00718.87
8.1.140.0070.00017.43
8.1.130.0030.00517.70
8.1.120.0040.00417.48
8.1.110.0000.00717.41
8.1.100.0070.00017.30
8.1.90.0040.00417.35
8.1.80.0000.00717.45
8.1.70.0000.00717.39
8.1.60.0030.00617.62
8.1.50.0050.00317.56
8.1.40.0000.00817.43
8.1.30.0040.00417.62
8.1.20.0020.00517.59
8.1.10.0040.00417.60
8.1.00.0040.00417.46
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0030.00318.45
8.0.270.0040.00417.23
8.0.260.0000.00617.26
8.0.250.0070.00017.07
8.0.240.0000.00717.04
8.0.230.0030.00317.05
8.0.220.0040.00416.85
8.0.210.0030.00316.91
8.0.200.0000.00716.91
8.0.190.0040.00417.04
8.0.180.0000.00716.90
8.0.170.0040.00416.82
8.0.160.0040.00416.99
8.0.150.0070.00016.90
8.0.140.0040.00416.75
8.0.130.0000.00613.41
8.0.120.0000.00716.87
8.0.110.0070.00016.73
8.0.100.0000.00816.78
8.0.90.0040.00416.78
8.0.80.0040.01316.88
8.0.70.0070.00016.98
8.0.60.0040.00416.86
8.0.50.0070.00016.77
8.0.30.0130.01117.10
8.0.20.0070.01217.40
8.0.10.0040.00416.84
8.0.00.0090.00916.57
7.4.330.0050.00015.02
7.4.320.0040.00716.52
7.4.300.0000.00716.47
7.4.290.0040.00416.57
7.4.280.0040.00416.61
7.4.270.0030.00316.46
7.4.260.0030.00316.38
7.4.250.0000.00716.45
7.4.240.0030.00316.60
7.4.230.0040.00416.62
7.4.220.0150.00616.49
7.4.210.0110.00816.57
7.4.200.0050.00216.43
7.4.160.0090.00616.68
7.4.150.0130.00417.40
7.4.140.0110.00617.86
7.4.130.0070.01016.61
7.4.120.0100.00916.38
7.4.110.0190.00816.50
7.4.100.0030.01816.54
7.4.90.0070.01016.59
7.4.80.0080.00819.39
7.4.70.0140.00316.58
7.4.60.0150.00316.60
7.4.50.0040.00416.72
7.4.40.0100.00616.64
7.4.30.0160.00316.57
7.4.10.0030.01317.94
7.4.00.0070.01116.45
7.3.330.0030.00313.42
7.3.320.0040.00413.38
7.3.310.0030.00316.47
7.3.300.0030.00316.37
7.3.290.0050.01116.43
7.3.280.0110.00816.41
7.3.270.0090.00917.40
7.3.260.0120.00416.64
7.3.250.0110.00616.49
7.3.240.0090.01216.31
7.3.230.0110.00616.47
7.3.210.0060.01016.53
7.3.200.0080.01119.39
7.3.190.0090.00916.47
7.3.180.0070.01016.34
7.3.170.0100.00716.47
7.3.160.0070.01516.44
7.3.130.0040.01417.94
7.3.120.0070.01017.94
7.3.110.0090.00917.94
7.3.100.0080.00817.94
7.3.90.0030.00717.94
7.3.80.0080.00017.94
7.3.70.0000.01417.94
7.3.60.0030.00617.94
7.3.50.0100.00317.94
7.3.40.0060.00317.94
7.3.30.0100.00017.94
7.3.20.0100.00317.94
7.3.10.0030.00617.94
7.3.00.0060.00617.94
7.2.330.0100.00716.65
7.2.320.0120.00816.39
7.2.310.0090.01216.75
7.2.300.0100.00716.76
7.2.290.0060.01616.80
7.2.260.0110.00717.94
7.2.250.0100.01017.94
7.2.240.0070.01017.94
7.2.230.0080.01217.94
7.2.220.0070.00717.94
7.2.210.0070.00717.94
7.2.200.0040.00717.94
7.2.190.0100.00317.94
7.2.180.0120.00317.94
7.2.170.0070.00417.94
7.2.160.0070.00717.94
7.2.150.0100.00317.94
7.2.140.0030.01017.94
7.2.130.0040.01217.94
7.2.120.0060.01017.94
7.2.110.0080.00817.94
7.2.100.0090.00017.94
7.2.90.0060.00317.94
7.2.80.0060.00617.94
7.2.70.0120.00317.94
7.2.60.0040.01117.45
7.2.50.0060.00917.94
7.2.40.0140.00017.94
7.2.30.0120.00317.94
7.2.20.0000.01517.94
7.2.10.0100.00317.94
7.2.00.0040.01118.55
7.1.330.0030.01017.94
7.1.320.0080.00817.94
7.1.310.0040.00817.94
7.1.300.0090.00617.94
7.1.290.0000.00817.94
7.1.280.0080.00317.94
7.1.270.0030.01017.94
7.1.260.0000.01217.94
7.1.250.0000.01417.94
7.1.240.0030.01017.94
7.1.230.0090.00317.94
7.1.220.0100.00317.94
7.1.210.0030.00617.94
7.1.200.0050.00916.89
7.1.190.0060.00317.94
7.1.180.0070.00717.94
7.1.170.0040.00417.94
7.1.160.0120.00317.94
7.1.150.0070.00717.94
7.1.140.0030.00617.94
7.1.130.0000.01517.94
7.1.120.0050.00517.94
7.1.110.0000.01317.94
7.1.100.0020.01018.17
7.1.90.0060.01017.94
7.1.80.0060.00317.94
7.1.70.0070.00717.51
7.1.60.0050.01518.53
7.1.50.0030.01417.52
7.1.40.0100.00317.94
7.1.30.0000.01417.94
7.1.20.0050.00817.94
7.1.10.0040.01217.94
7.1.00.0050.04320.15
7.0.330.0070.00717.94
7.0.320.0040.01117.94
7.0.310.0000.00917.94
7.0.300.0080.00417.94
7.0.290.0000.01417.94
7.0.280.0060.00617.94
7.0.270.0030.00617.94
7.0.260.0060.00317.94
7.0.250.0130.00017.94
7.0.240.0000.01117.94
7.0.230.0000.01217.94
7.0.220.0060.00617.94
7.0.210.0000.01217.94
7.0.200.0080.00317.44
7.0.190.0000.01317.94
7.0.180.0030.01317.94
7.0.170.0000.01617.94
7.0.160.0140.00017.94
7.0.150.0060.00617.94
7.0.140.0010.04119.96
7.0.130.0040.00417.94
7.0.120.0050.03319.99
7.0.110.0040.02519.93
7.0.100.0040.04620.07
7.0.90.0050.03319.98
7.0.80.0060.03220.01
7.0.70.0000.02820.03
7.0.60.0070.04219.91
7.0.50.0050.02320.01
7.0.40.0030.04019.00
7.0.30.0030.04118.96
7.0.20.0020.02119.03
7.0.10.0070.03519.03
7.0.00.0050.04219.01
5.6.400.0040.00817.94
5.6.390.0030.00617.94
5.6.380.0030.01017.94
5.6.370.0100.00617.94
5.6.360.0100.00017.94
5.6.350.0070.00317.94
5.6.340.0000.01017.94
5.6.330.0030.01117.94
5.6.320.0040.00717.94
5.6.310.0050.00517.94
5.6.300.0070.00717.94
5.6.290.0000.01317.94
5.6.280.0050.04019.49
5.6.270.0070.02219.38
5.6.260.0080.03819.47
5.6.250.0050.03619.49
5.6.240.0080.04019.48
5.6.230.0020.02619.40
5.6.220.0040.05119.48
5.6.210.0030.02519.43
5.6.200.0040.04919.36
5.6.190.0040.02619.37
5.6.180.0080.02319.41
5.6.170.0050.03319.47
5.6.160.0070.04719.33
5.6.150.0020.04719.48
5.6.140.0100.03919.37
5.6.130.0050.04519.48
5.6.120.0050.03219.44
5.6.110.0070.04319.45
5.6.100.0060.04219.43
5.6.90.0050.03619.45
5.6.80.0030.04219.13
5.6.70.0040.04119.15
5.6.60.0050.03319.00
5.6.50.0030.04219.16
5.6.40.0030.03719.09
5.6.30.0030.03519.14
5.6.20.0030.02819.05
5.6.10.0060.03519.12
5.6.00.0030.02519.03
5.5.380.0070.04317.74
5.5.370.0020.02217.73
5.5.360.0050.02117.81
5.5.350.0020.02017.78
5.5.340.0030.02517.92
5.5.330.0150.01718.01
5.5.320.0000.02818.04
5.5.310.0000.02518.02
5.5.300.0030.04317.96
5.5.290.0020.04518.01
5.5.280.0090.02517.93
5.5.270.0050.04518.07
5.5.260.0030.02718.08
5.5.250.0100.03217.94
5.5.240.0050.01817.73
5.5.230.0020.03217.62
5.5.220.0050.03917.70
5.5.210.0050.02117.72
5.5.200.0030.03917.76
5.5.190.0050.04117.70
5.5.180.0050.02417.67
5.5.170.0070.01317.94
5.5.160.0050.02317.68
5.5.150.0030.02517.61
5.5.140.0030.02817.71
5.5.130.0090.03117.76
5.5.120.0030.02317.61
5.5.110.0040.03917.68
5.5.100.0070.02517.57
5.5.90.0000.02917.58
5.5.80.0050.04617.65
5.5.70.0040.03917.66
5.5.60.0040.02017.56
5.5.50.0030.03117.57
5.5.40.0050.04017.54
5.5.30.0020.02517.55
5.5.20.0050.02417.50
5.5.10.0070.04017.65
5.5.00.0020.02517.50
5.4.450.0110.02018.72
5.4.440.0050.02218.77
5.4.430.0030.04318.72
5.4.420.0030.03118.70
5.4.410.0030.02318.63
5.4.400.0050.04218.57
5.4.390.0050.03218.44
5.4.380.0030.04218.57
5.4.370.0030.03518.51
5.4.360.0020.02018.49
5.4.350.0070.03818.61
5.4.340.0070.04218.52
5.4.330.0030.00317.94
5.4.320.0000.03018.56
5.4.310.0050.03218.52
5.4.300.0000.03518.62
5.4.290.0100.01818.56
5.4.280.0020.02318.43
5.4.270.0000.03518.42
5.4.260.0050.03218.42
5.4.250.0070.02218.46
5.4.240.0030.02318.46
5.4.230.0030.03818.51
5.4.220.0080.02118.56
5.4.210.0070.01818.48
5.4.200.0030.02318.53
5.4.190.0010.02618.43
5.4.180.0040.02218.60
5.4.170.0030.03018.48
5.4.160.0070.03818.59
5.4.150.0030.03618.44
5.4.140.0020.02217.12
5.4.130.0050.01817.12
5.4.120.0030.02117.14
5.4.110.0030.02117.22
5.4.100.0030.03917.21
5.4.90.0020.02517.20
5.4.80.0040.01817.19
5.4.70.0020.02517.14
5.4.60.0060.01817.19
5.4.50.0040.02017.22
5.4.40.0030.02317.24
5.4.30.0080.01817.11
5.4.20.0070.01417.21
5.4.10.0050.01717.14
5.4.00.0050.01616.86
5.3.290.0000.07014.75
5.3.280.0000.05314.73
5.3.270.0030.07714.62
5.3.260.0030.04014.60
5.3.250.0070.03314.58
5.3.240.0000.03714.58
5.3.230.0000.03314.61
5.3.220.0000.03714.43
5.3.210.0000.04014.79
5.3.200.0000.04014.56
5.3.190.0000.05714.65
5.3.180.0030.03314.59
5.3.170.0070.03714.42
5.3.160.0030.03314.65
5.3.150.0000.04014.70
5.3.140.0000.03314.41
5.3.130.0030.06314.40
5.3.120.0000.03714.77
5.3.110.0000.05014.63
5.3.100.0000.03714.06
5.3.90.0030.05714.12
5.3.80.0000.06014.04
5.3.70.0070.03014.03
5.3.60.0030.03314.01
5.3.50.0030.02714.01
5.3.40.0030.03314.07
5.3.30.0000.03713.89
5.3.20.0000.07313.72
5.3.10.0000.03313.69
5.3.00.0000.03713.61
5.2.170.0000.03011.28
5.2.160.0000.02711.14
5.2.150.0000.03311.10
5.2.140.0030.05011.13
5.2.130.0000.06311.05
5.2.120.0030.05011.06
5.2.110.0000.03711.05
5.2.100.0000.02711.09
5.2.90.0000.02711.08
5.2.80.0000.03011.18
5.2.70.0000.03011.18
5.2.60.0000.03711.05
5.2.50.0000.04311.08
5.2.40.0000.03011.00
5.2.30.0000.05311.05
5.2.20.0000.02711.11
5.2.10.0000.03010.86
5.2.00.0070.02710.73
5.1.60.0000.02310.07
5.1.50.0030.02010.24
5.1.40.0030.02310.15
5.1.30.0030.02310.57
5.1.20.0030.02310.34
5.1.10.0030.0339.89
5.1.00.0000.03010.05
5.0.50.0030.0179.54
5.0.40.0000.0309.54
5.0.30.0000.0379.54
5.0.20.0000.0239.54
5.0.10.0000.0209.54
5.0.00.0000.0309.54
4.4.90.0000.0139.54
4.4.80.0000.0179.54
4.4.70.0000.0139.54
4.4.60.0000.0239.54
4.4.50.0000.0239.54
4.4.40.0000.0339.54
4.4.30.0000.0279.54
4.4.20.0000.0139.54
4.4.10.0000.0179.54
4.4.00.0030.0239.54
4.3.110.0000.0139.54
4.3.100.0000.0139.54
4.3.90.0000.0179.54
4.3.80.0000.0239.54
4.3.70.0030.0109.54
4.3.60.0000.0309.54
4.3.50.0030.0109.54
4.3.40.0000.0379.54
4.3.30.0000.0409.54
4.3.20.0070.0309.54
4.3.10.0030.0279.54
4.3.00.0000.0339.54

preferences:
45.05 ms | 400 KiB | 5 Q