3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverse($string) { $substr1 = ""; $substr2 = ""; $strLength = strlen($string); for ($i = 0; $i < ($strLength / 2); $i++) { $substr1 .= $string[$strLength-$i]; $substr2 .= $string[$strLength / 2 - $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.70.0090.00618.68
8.3.60.0060.00918.68
8.3.50.0160.00621.27
8.3.40.0060.01218.96
8.3.30.0100.00319.18
8.3.20.0040.00420.33
8.3.10.0050.00323.48
8.3.00.0040.00419.38
8.2.180.0070.01016.88
8.2.170.0120.00322.96
8.2.160.0070.01020.32
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0000.00822.22
8.2.110.0060.00322.07
8.2.100.0060.00617.75
8.2.90.0030.00619.22
8.2.80.0000.00817.97
8.2.70.0040.00417.48
8.2.60.0050.00517.93
8.2.50.0030.00618.07
8.2.40.0060.00320.07
8.2.30.0040.00418.20
8.2.20.0000.00817.67
8.2.10.0030.00618.11
8.2.00.0000.00717.70
8.1.280.0000.01525.92
8.1.270.0050.00322.05
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0000.00924.02
8.1.230.0000.01119.26
8.1.220.0030.00617.74
8.1.210.0080.00018.77
8.1.200.0000.00917.23
8.1.190.0030.00617.10
8.1.180.0000.00718.10
8.1.170.0120.00018.71
8.1.160.0000.00721.96
8.1.150.0000.00718.94
8.1.140.0000.00717.25
8.1.130.0040.00419.61
8.1.120.0060.00317.41
8.1.110.0000.00717.41
8.1.100.0040.00417.35
8.1.90.0000.00717.30
8.1.80.0030.00317.41
8.1.70.0000.00717.37
8.1.60.0000.00917.65
8.1.50.0090.00017.59
8.1.40.0000.00717.49
8.1.30.0000.00917.51
8.1.20.0050.00317.68
8.1.10.0050.00217.49
8.1.00.0000.00717.37
8.0.300.0040.00418.77
8.0.290.0000.00716.58
8.0.280.0070.00018.45
8.0.270.0070.00017.18
8.0.260.0030.00317.20
8.0.250.0030.00316.92
8.0.240.0040.00416.95
8.0.230.0030.00316.91
8.0.220.0040.00416.92
8.0.210.0000.00716.86
8.0.200.0040.00416.99
8.0.190.0000.00717.05
8.0.180.0000.00717.00
8.0.170.0000.00816.95
8.0.160.0070.00016.96
8.0.150.0000.00716.91
8.0.140.0000.00716.88
8.0.130.0030.00313.40
8.0.120.0060.00316.90
8.0.110.0000.00716.84
8.0.100.0040.00416.83
8.0.90.0000.00717.04
8.0.80.0120.00616.97
8.0.70.0030.00517.03
8.0.60.0040.00416.94
8.0.50.0070.00016.81
8.0.30.0170.00317.26
8.0.20.0120.01117.40
8.0.10.0040.00416.89
8.0.00.0100.00816.83
7.4.330.0030.00315.02
7.4.320.0060.00316.60
7.4.300.0030.00316.43
7.4.290.0060.00016.58
7.4.280.0000.00716.60
7.4.270.0030.00316.51
7.4.260.0070.00016.39
7.4.250.0000.00716.60
7.4.240.0000.00716.62
7.4.230.0030.00316.42
7.4.220.0150.00916.64
7.4.210.0100.01016.51
7.4.200.0040.00416.40
7.4.160.0070.00716.65
7.4.150.0150.00317.40
7.4.140.0070.01117.86
7.4.130.0100.00716.51
7.4.120.0080.01116.65
7.4.110.0120.00816.43
7.4.100.0090.00916.56
7.4.90.0030.01316.58
7.4.80.0090.00919.39
7.4.70.0100.00716.45
7.4.60.0060.01316.50
7.4.50.0080.00016.43
7.4.40.0030.01416.55
7.4.30.0030.01716.59
7.4.00.0080.00815.15
7.3.330.0060.00013.44
7.3.320.0030.00313.22
7.3.310.0050.00216.41
7.3.300.0000.00716.39
7.3.290.0070.00916.43
7.3.280.0110.00816.44
7.3.270.0130.00617.40
7.3.260.0120.01216.38
7.3.250.0090.00916.45
7.3.240.0160.00016.36
7.3.230.0070.01016.61
7.3.210.0180.00316.56
7.3.200.0090.00919.39
7.3.190.0060.01316.45
7.3.180.0080.00816.41
7.3.170.0140.00316.64
7.3.160.0100.01016.50
7.3.10.0070.00716.58
7.3.00.0070.00516.56
7.2.330.0080.00816.71
7.2.320.0090.00916.87
7.2.310.0060.01616.64
7.2.300.0140.00316.68
7.2.290.0130.01016.61
7.2.130.0070.00816.80
7.2.120.0040.01016.82
7.2.110.0040.00816.93
7.2.100.0030.00816.99
7.2.90.0060.00616.93
7.2.80.0050.00917.00
7.2.70.0060.00516.85
7.2.60.0070.00717.07
7.2.50.0060.00616.89
7.2.40.0070.00616.79
7.2.30.0050.00616.94
7.2.20.0040.01016.95
7.2.10.0060.00816.93
7.2.00.0020.00917.53
7.1.250.0080.00615.73
7.1.240.0000.01715.94
7.1.230.0090.00615.76
7.1.220.0070.00415.76
7.1.210.0030.00515.95
7.1.200.0070.01015.64
7.1.190.0090.00615.70
7.1.180.0030.00915.76
7.1.170.0060.00615.80
7.1.160.0140.00015.82
7.1.150.0060.00615.83
7.1.140.0110.00015.87
7.1.130.0100.00315.88
7.1.120.0040.01115.63
7.1.110.0100.00315.50
7.1.100.0060.00916.73
7.1.90.0030.01415.57
7.1.80.0100.00615.85
7.1.70.0040.00816.49
7.1.60.0080.01217.36
7.1.50.0100.01016.48
7.1.40.0070.00715.58
7.1.30.0040.01115.91
7.1.20.0060.00615.87
7.1.10.0070.01015.89
7.1.00.0050.04519.07
7.0.330.0070.00715.53
7.0.320.0070.00715.32
7.0.310.0080.00415.18
7.0.300.0030.01015.37
7.0.290.0080.00815.40
7.0.280.0080.00815.34
7.0.270.0030.01215.24
7.0.260.0120.00315.22
7.0.250.0070.00315.41
7.0.240.0060.00615.42
7.0.230.0030.01015.55
7.0.220.0040.01115.33
7.0.210.0050.00315.28
7.0.200.0030.00615.92
7.0.190.0060.00315.01
7.0.180.0030.01015.39
7.0.170.0000.00915.40
7.0.160.0060.00615.05
7.0.150.0070.00715.54
7.0.140.0050.04118.62
7.0.130.0110.00315.40
7.0.120.0070.00715.52
7.0.110.0120.00315.26
7.0.100.0050.00315.14
7.0.90.0070.00715.43
7.0.80.0070.00315.52
7.0.70.0070.00015.46
7.0.60.0110.01517.72
7.0.50.0050.03916.74
7.0.40.0090.03716.89
7.0.30.0270.04516.90
7.0.20.0120.03316.80
7.0.10.0020.03416.88
7.0.00.0100.03916.85
5.6.380.0090.00614.38
5.6.370.0030.00614.20
5.6.360.0060.00914.56
5.6.350.0100.00714.13
5.6.340.0060.01014.09
5.6.330.0060.00914.34
5.6.320.0100.00314.73
5.6.310.0030.01414.13
5.6.300.0000.01114.82
5.6.290.0000.01314.38
5.6.280.0020.04117.65
5.6.270.0070.00714.23
5.6.260.0000.00814.12
5.6.250.0030.01014.46
5.6.240.0040.01114.39
5.6.230.0030.01014.21
5.6.220.0140.00014.29
5.6.210.0050.03017.43
5.6.200.0030.04916.29
5.6.190.0050.04717.47
5.6.180.0120.02017.53
5.6.170.0240.04317.31
5.6.160.0050.04817.50
5.6.150.0070.02716.30
5.6.140.0100.03816.29
5.6.130.0060.03316.25
5.6.120.0110.04317.68
5.6.110.0030.02917.75
5.6.100.0070.03017.50
5.6.90.0060.04517.74
5.6.80.0020.02517.22
5.6.70.2100.02217.33
5.6.60.0070.00714.29
5.6.50.0030.00614.34
5.6.40.0030.00614.27
5.6.30.0120.00314.07
5.6.20.0050.00314.13
5.6.10.0040.00814.41
5.6.00.0030.01014.30
5.5.380.0040.00411.18
5.5.370.0040.00411.50
5.5.360.0030.00311.25
5.5.350.0080.03615.89
5.5.340.0020.02614.56
5.5.330.0030.03615.79
5.5.320.0150.03315.79
5.5.310.0170.04015.70
5.5.300.0030.04214.76
5.5.290.0030.02614.58
5.5.280.0090.04315.97
5.5.270.0090.04016.02
5.5.260.0090.04216.09
5.5.250.0100.03315.86
5.5.240.0150.04015.62
5.5.230.0030.00611.18
5.5.220.0100.00011.25
5.5.210.0030.00911.23
5.5.200.0040.00711.34
5.5.190.0000.01211.18
5.5.180.0060.00311.31
5.5.170.0050.00011.48
5.5.160.0000.00811.41
5.5.150.0030.00811.18
5.5.140.0000.01011.18
5.5.130.0030.00311.18
5.5.120.0070.00311.18
5.5.110.0060.00311.26
5.5.100.0000.01211.18
5.5.90.0060.00611.18
5.5.80.0030.00611.18
5.5.70.0000.00811.18
5.5.60.0070.00311.37
5.5.50.0030.00911.29
5.5.40.0070.00411.18
5.5.30.0030.00311.18
5.5.20.0040.00811.18
5.5.10.0030.00911.26
5.5.00.0030.01011.41
5.4.450.0420.03115.42
5.4.440.0340.03415.25
5.4.430.0380.03015.38
5.4.420.0300.02915.26
5.4.410.0400.02815.31
5.4.400.0320.03515.23
5.4.390.0280.03315.09
5.4.380.0130.02315.25
5.4.370.0470.02815.21
5.4.360.0120.02515.08
5.4.350.0270.03415.04
5.4.340.0030.02311.68
5.4.330.0000.00911.18
5.4.320.0040.02211.85
5.4.310.0070.02111.90
5.4.300.0030.02411.84
5.4.290.0040.02211.84
5.4.280.0020.02711.88
5.4.270.0070.01911.79
5.4.260.0040.02211.82
5.4.250.0060.02011.79
5.4.240.0070.01911.79
5.4.230.0060.02111.79
5.4.220.0070.02311.78
5.4.210.0060.02011.82
5.4.200.0050.02111.78
5.4.190.0030.02311.78
5.4.180.0040.02311.78
5.4.170.0050.02811.79
5.4.160.0040.02211.79
5.4.150.0060.02011.78
5.4.140.0060.02111.63
5.4.130.0060.01911.62
5.4.120.0040.02211.59
5.4.110.0040.02011.60
5.4.100.0040.02111.59
5.4.90.0090.01911.60
5.4.80.0020.02211.59
5.4.70.0050.02111.68
5.4.60.0020.02511.59
5.4.50.0070.01911.66
5.4.40.0060.02011.59
5.4.30.0040.02611.58
5.4.20.0030.02211.59
5.4.10.0060.01611.60
5.4.00.0090.02111.34
5.3.290.0050.02411.99
5.3.280.0060.02311.94
5.3.270.0030.02411.95
5.3.260.0050.03011.95
5.3.250.0070.02111.95
5.3.240.0070.02811.95
5.3.230.0020.02911.94
5.3.220.0040.02211.93
5.3.210.0070.02211.93
5.3.200.0040.02411.93
5.3.190.0040.02311.93
5.3.180.0040.02511.93
5.3.170.0050.02211.92
5.3.160.0060.02011.92
5.3.150.0050.02211.92
5.3.140.0040.02111.92
5.3.130.0040.03011.92
5.3.120.0060.02311.92
5.3.110.0040.02811.92
5.3.100.0030.02311.65
5.3.90.0080.02211.64
5.3.80.0040.02311.63
5.3.70.0060.01911.63
5.3.60.0060.01911.63
5.3.50.0050.02111.60
5.3.40.0080.01911.60
5.3.30.0050.02011.58
5.3.20.0040.02111.47
5.3.10.0070.02011.45
5.3.00.0030.02211.45
5.2.170.0030.02010.20
5.2.160.0080.01310.20
5.2.150.0040.01610.20
5.2.140.0040.01710.20
5.2.130.0020.01810.18
5.2.120.0040.01910.18
5.2.110.0050.02310.18
5.2.100.0030.01710.18
5.2.90.0020.01610.18
5.2.80.0040.01910.17
5.2.70.0040.01510.17
5.2.60.0040.01910.15
5.2.50.0030.01810.13
5.2.40.0040.02110.13
5.2.30.0080.02010.11
5.2.20.0040.01810.11
5.2.10.0040.01610.06
5.2.00.0050.0179.99
5.1.60.0050.0129.63
5.1.50.0040.0149.63
5.1.40.0020.0159.62
5.1.30.0030.0179.79
5.1.20.0070.0149.80
5.1.10.0030.0159.67
5.1.00.0030.0159.67
5.0.50.0030.0128.91
5.0.40.0020.0108.84
5.0.30.0020.0188.74
5.0.20.0020.0138.72
5.0.10.0040.0138.72
5.0.00.0040.0168.71
4.4.90.0040.0097.98
4.4.80.0030.0087.97
4.4.70.0010.0117.96
4.4.60.0040.0097.96
4.4.50.0040.0097.97
4.4.40.0010.0167.94
4.4.30.0030.0077.97
4.4.20.0010.0128.01
4.4.10.0010.0118.01
4.4.00.0010.0177.97
4.3.110.0010.0117.92
4.3.100.0030.0107.92
4.3.90.0040.0117.91
4.3.80.0010.0167.88
4.3.70.0020.0097.90
4.3.60.0040.0077.90
4.3.50.0020.0097.90
4.3.40.0040.0137.86
4.3.30.0010.0117.24
4.3.20.0040.0097.22
4.3.10.0030.0157.21
4.3.00.0020.0139.05

preferences:
56.64 ms | 401 KiB | 5 Q