3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "racecar"; $pal = ""; for($a=0; $a<strlen($str); $a++) { for($z=0; $z<strlen($str); $z++) $subs = substr($str, $a, $z); if( $subs == strrev($subs) and strlen($subs) > strlen($pal) ) { echo $a; $pal = $subs; } } echo $pal;

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.0100.00618.55
8.3.50.0090.00917.33
8.3.40.0090.00618.63
8.3.30.0070.00718.60
8.3.20.0000.00818.66
8.3.10.0080.00020.59
8.3.00.0040.00417.38
8.2.180.0120.00916.75
8.2.170.0060.00922.96
8.2.160.0000.01422.27
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0060.00321.11
8.2.100.0070.00417.72
8.2.90.0060.00319.27
8.2.80.0050.00217.93
8.2.70.0040.00417.63
8.2.60.0030.00517.93
8.2.50.0050.00318.07
8.2.40.0040.00418.22
8.2.30.0040.00418.10
8.2.20.0030.00517.70
8.2.10.0000.00717.64
8.2.00.0080.00017.86
8.1.280.0070.00725.92
8.1.270.0060.00323.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00322.52
8.1.230.0040.00721.03
8.1.220.0040.00417.78
8.1.210.0030.00518.85
8.1.200.0030.00617.35
8.1.190.0000.00817.40
8.1.180.0030.00618.10
8.1.170.0050.00318.84
8.1.160.0000.00718.84
8.1.150.0050.00218.61
8.1.140.0040.00417.28
8.1.130.0040.00417.88
8.1.120.0030.00317.50
8.1.110.0030.00717.42
8.1.100.0050.00317.44
8.1.90.0040.00317.44
8.1.80.0030.00517.35
8.1.70.0070.00017.47
8.1.60.0040.00417.55
8.1.50.0000.00717.44
8.1.40.0040.00417.45
8.1.30.0040.00417.52
8.1.20.0000.00817.68
8.1.10.0030.00617.50
8.1.00.0060.00317.40
8.0.300.0030.00620.02
8.0.290.0040.00416.75
8.0.280.0040.00418.35
8.0.270.0050.00217.24
8.0.260.0000.00718.67
8.0.250.0000.00716.86
8.0.240.0060.00316.96
8.0.230.0030.00316.93
8.0.220.0030.00316.81
8.0.210.0070.00016.85
8.0.200.0000.00616.94
8.0.190.0040.00416.95
8.0.180.0070.00016.92
8.0.170.0000.00816.87
8.0.160.0040.00416.77
8.0.150.0070.00316.91
8.0.140.0040.00416.89
8.0.130.0000.00613.24
8.0.120.0000.00816.73
8.0.110.0080.00016.99
8.0.100.0000.00816.77
8.0.90.0040.00416.78
8.0.80.0090.00616.83
8.0.70.0030.00616.77
8.0.60.0000.00716.75
8.0.50.0080.00016.83
8.0.30.0120.01017.03
8.0.20.0100.00817.24
8.0.10.0020.00516.85
8.0.00.0140.00516.90
7.4.330.0050.00014.84
7.4.320.0050.00516.48
7.4.300.0020.00516.56
7.4.290.0060.00016.51
7.4.280.0030.00616.64
7.4.270.0040.00416.43
7.4.260.0000.00713.29
7.4.250.0030.00516.59
7.4.240.0030.00516.44
7.4.230.0030.00316.58
7.4.220.0120.00616.68
7.4.210.0080.01116.57
7.4.200.0000.00716.47
7.4.190.0030.00316.73
7.4.160.0100.00716.65
7.4.150.0130.00417.07
7.4.140.0090.01117.17
7.4.130.0060.01016.61
7.4.120.0120.00516.44
7.4.110.0060.01016.63
7.4.100.0100.00716.41
7.4.90.0100.00716.49
7.4.80.0150.00618.80
7.4.70.0140.01116.36
7.4.60.0060.00916.48
7.4.50.0000.00916.52
7.4.40.0090.00922.27
7.4.30.0060.01016.49
7.4.00.0140.00314.98
7.3.330.0000.00613.16
7.3.320.0000.00613.18
7.3.310.0000.00716.39
7.3.300.0030.00316.42
7.3.290.0100.00416.30
7.3.280.0080.00916.33
7.3.270.0150.00317.07
7.3.260.0110.01118.24
7.3.250.0090.01216.46
7.3.240.0100.00616.59
7.3.230.0130.00316.39
7.3.210.0150.00316.53
7.3.200.0060.01619.39
7.3.190.0110.00716.64
7.3.180.0080.00916.57
7.3.170.0080.00816.46
7.3.160.0100.00616.33
7.3.120.0090.00614.79
7.2.330.0070.01416.61
7.2.320.0070.01516.44
7.2.310.0080.01416.61
7.2.300.0130.00316.55
7.2.290.0080.01116.63
7.2.60.0030.01016.99
7.2.00.0030.01019.41
7.1.200.0070.00715.73
7.1.100.0050.00518.04
7.1.70.0000.00817.05
7.1.60.0170.00719.40
7.1.50.0030.00717.11
7.1.00.0000.08022.45
7.0.200.0070.00016.88
7.0.140.0070.07321.93
7.0.60.0130.06319.98
7.0.50.0030.05017.80
7.0.40.0070.04320.30
7.0.30.0330.06720.33
7.0.20.0370.07020.32
7.0.10.0170.04320.02
7.0.00.0070.07020.20
5.6.210.0070.08020.44
5.6.200.0070.04718.18
5.6.190.0030.05020.67
5.6.180.0300.06320.67
5.6.170.0100.06320.38
5.6.160.0100.04020.48
5.6.150.0030.04718.09
5.6.140.0070.07718.21
5.6.130.0030.04018.14
5.6.120.0030.07021.08
5.6.110.0000.06321.01
5.6.100.0170.07320.95
5.6.90.0070.08020.94
5.6.80.0070.07320.50
5.5.350.0300.07320.43
5.5.340.0070.06317.89
5.5.330.0070.05720.40
5.5.320.0330.07320.29
5.5.310.0370.06720.26
5.5.300.0130.04718.01
5.5.290.0100.04318.00
5.5.280.0100.08020.84
5.5.270.0170.07720.86
5.5.260.0070.03720.87
5.5.250.0000.04320.68
5.5.240.0230.07720.18
5.4.450.0030.04019.40
5.4.440.0000.06719.52
5.4.430.0030.04019.11
5.4.420.0070.03719.23
5.4.410.0000.04019.11
5.4.400.0070.04318.96
5.4.390.0070.03718.79
5.4.380.0030.06319.18
5.4.370.0100.07319.02
5.4.360.0030.03719.18
5.4.350.0070.03319.14
5.4.340.0070.08318.79
5.4.320.0030.04019.14
5.4.310.0030.07719.16
5.4.300.0030.07018.91
5.4.290.0070.07718.78
5.4.280.0070.05718.91
5.4.270.0030.04019.21
5.4.260.0100.07319.00
5.4.250.0070.03318.91
5.4.240.0100.04018.90
5.4.230.0070.03319.15
5.4.220.0000.04019.19
5.4.210.0100.03319.08
5.4.200.0100.05019.07
5.4.190.0000.04019.07
5.4.180.0000.04019.07
5.4.170.0030.07719.07
5.4.160.0070.07319.09
5.4.150.0100.03719.12
5.4.140.0070.05716.33
5.4.130.0070.06316.37
5.4.120.0070.05016.33
5.4.110.0130.06316.41
5.4.100.0030.06316.14
5.4.90.0100.06016.37
5.4.80.0070.07016.38
5.4.70.0070.03016.31
5.4.60.0130.03316.38
5.4.50.0130.06016.31
5.4.40.0100.07316.26
5.4.30.0000.03716.39
5.4.20.0000.04716.22
5.4.10.0030.04016.38
5.4.00.0000.04015.81
5.3.290.0030.07014.75
5.3.280.0100.07714.53
5.3.270.0100.06014.54
5.3.260.0030.03714.53
5.3.250.0000.04314.54
5.3.240.0030.04314.58
5.3.230.0030.04314.57
5.3.220.0070.04014.53
5.3.210.0030.04714.36
5.3.200.0030.05714.58
5.3.190.0100.06014.52
5.3.180.0000.04014.52
5.3.170.0030.05314.52
5.3.160.0070.07014.54
5.3.150.0170.06714.49
5.3.140.0070.04714.53
5.3.130.0100.07314.44
5.3.120.0030.08014.51
5.3.110.0000.04714.36
5.3.100.0030.04014.13
5.3.90.0000.08013.91
5.3.80.0000.04714.03
5.3.70.0070.03314.11
5.3.60.0070.03313.93
5.3.50.0030.07313.76
5.3.40.0100.03013.88
5.3.30.0070.05013.86
5.3.20.0030.06713.51
5.3.10.0030.03713.49
5.3.00.0000.05713.57
5.2.170.0070.03711.08
5.2.160.0130.02010.96
5.2.150.0030.02711.07
5.2.140.0030.04011.29
5.2.130.0030.03311.03
5.2.120.0000.05011.04
5.2.110.0070.02311.01
5.2.100.0070.06311.00
5.2.90.0070.02311.03
5.2.80.0070.05711.03
5.2.70.0100.06310.98
5.2.60.0030.06310.97
5.2.50.0070.05710.91
5.2.40.0030.05010.91
5.2.30.0000.03010.79
5.2.20.0030.04010.94
5.2.10.0000.03311.01
5.2.00.0030.02710.67
5.1.60.0070.02010.00
5.1.50.0000.02710.05
5.1.40.0030.0239.88
5.1.30.0000.02710.32
5.1.20.0030.02710.39
5.1.10.0070.02010.08
5.1.00.0000.03010.07
5.0.50.0000.0208.70
5.0.40.0000.0238.31
5.0.30.0030.0338.22
5.0.20.0030.0178.24
5.0.10.0030.0208.18
5.0.00.0000.0308.15
4.4.90.0030.0277.61
4.4.80.0000.0407.61
4.4.70.0000.0337.61
4.4.60.0030.0207.61
4.4.50.0000.0377.61
4.4.40.0030.0237.61
4.4.30.0000.0177.61
4.4.20.0000.0177.61
4.4.10.0000.0177.61
4.4.00.0000.0237.61
4.3.110.0030.0177.61
4.3.100.0000.0137.61
4.3.90.0030.0137.61
4.3.80.0000.0237.61
4.3.70.0000.0137.61
4.3.60.0000.0137.61
4.3.50.0000.0137.61
4.3.40.0000.0237.61
4.3.30.0030.0107.61
4.3.20.0000.0137.61
4.3.10.0000.0137.61
4.3.00.0070.0107.61

preferences:
54.24 ms | 400 KiB | 5 Q