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++) { echo $a; $subs = substr($str, $a, $z); if( $subs == strrev($subs) and strlen($subs) > strlen($pal) ) { $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.70.0110.00718.31
8.3.60.0060.01316.50
8.3.50.0100.01118.29
8.3.40.0000.01418.54
8.3.30.0040.01118.54
8.3.20.0090.00018.64
8.3.10.0080.00020.38
8.3.00.0050.00519.13
8.2.180.0110.00418.17
8.2.170.0040.01122.96
8.2.160.0070.00720.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00519.31
8.2.110.0040.00419.38
8.2.100.0080.00417.72
8.2.90.0050.00520.81
8.2.80.0040.00419.37
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0080.00018.07
8.2.40.0060.00318.22
8.2.30.0030.00518.11
8.2.20.0000.00817.77
8.2.10.0040.00417.85
8.2.00.0080.00017.72
8.1.280.0090.01225.92
8.1.270.0050.00324.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00022.26
8.1.230.0040.00820.97
8.1.220.0000.00818.77
8.1.210.0030.00518.91
8.1.200.0000.01017.23
8.1.190.0000.00717.51
8.1.180.0030.00518.10
8.1.170.0000.00718.91
8.1.160.0040.00418.79
8.1.150.0000.00718.63
8.1.140.0000.00717.51
8.1.130.0000.00717.82
8.1.120.0000.00717.30
8.1.110.0050.00217.40
8.1.100.0040.00417.43
8.1.90.0030.00317.29
8.1.80.0070.00017.49
8.1.70.0030.00517.41
8.1.60.0040.00417.47
8.1.50.0040.00417.46
8.1.40.0040.00417.48
8.1.30.0040.00417.65
8.1.20.0040.00417.48
8.1.10.0000.00717.58
8.1.00.0000.00817.43
8.0.300.0040.00420.04
8.0.290.0070.00016.63
8.0.280.0030.00318.46
8.0.270.0080.00017.26
8.0.260.0000.00616.88
8.0.250.0040.00416.94
8.0.240.0050.00216.89
8.0.230.0000.00616.84
8.0.220.0030.00316.80
8.0.210.0000.00716.88
8.0.200.0060.00016.84
8.0.190.0040.00416.91
8.0.180.0040.00416.84
8.0.170.0050.00516.89
8.0.160.0030.00317.00
8.0.150.0000.00816.87
8.0.140.0040.00416.86
8.0.130.0060.00013.25
8.0.120.0040.00416.85
8.0.110.0000.00716.92
8.0.100.0070.00016.91
8.0.90.0070.00016.71
8.0.80.0120.00916.95
8.0.70.0070.00016.67
8.0.60.0000.00816.87
8.0.50.0000.00716.77
8.0.30.0100.01016.87
8.0.20.0110.00916.98
8.0.10.0040.00416.81
8.0.00.0100.00916.69
7.4.330.0060.00013.02
7.4.320.0030.00316.60
7.4.300.0030.00316.59
7.4.290.0050.00316.46
7.4.280.0040.00416.59
7.4.270.0000.00616.50
7.4.260.0030.00313.26
7.4.250.0030.00616.48
7.4.240.0030.00316.59
7.4.230.0040.00416.48
7.4.220.0100.00716.59
7.4.210.0070.00816.60
7.4.200.0030.00316.44
7.4.190.0040.00416.67
7.4.160.0130.00316.60
7.4.150.0120.00616.44
7.4.140.0060.01216.53
7.4.130.0140.00516.43
7.4.120.0100.00816.50
7.4.110.0140.00316.38
7.4.100.0170.00716.52
7.4.90.0120.00616.62
7.4.80.0070.01019.39
7.4.70.0090.00916.57
7.4.60.0060.01016.52
7.4.50.0060.00616.34
7.4.40.0040.01116.39
7.4.30.0090.01216.40
7.4.00.0090.00614.92
7.3.330.0060.00013.19
7.3.320.0000.00613.20
7.3.310.0050.00316.45
7.3.300.0000.00616.18
7.3.290.0090.00616.35
7.3.280.0080.01116.32
7.3.270.0060.01816.26
7.3.260.0070.01016.38
7.3.250.0100.00916.46
7.3.240.0040.01316.55
7.3.230.0130.00316.53
7.3.210.0090.00916.20
7.3.200.0090.00616.43
7.3.190.0080.00816.38
7.3.180.0060.01016.56
7.3.170.0080.00816.30
7.3.160.0070.01016.39
7.3.120.0040.01215.07
7.2.330.0120.00416.62
7.2.320.0100.01316.71
7.2.310.0160.00316.68
7.2.300.0090.00916.73
7.2.290.0110.00516.75
7.2.00.0000.01719.20
7.1.200.0000.01415.84
7.1.100.0030.01017.99
7.1.70.0800.00915.25
7.1.60.0030.01017.29
7.1.50.0070.01416.99
7.1.00.0000.05722.57
7.0.200.0030.00516.87
7.0.140.0100.06722.15
7.0.120.0070.03022.04
7.0.60.0030.07020.03
7.0.50.0000.08717.77
7.0.40.0070.07020.20
7.0.30.0270.06720.30
7.0.20.0200.09020.19
7.0.10.0070.08020.04
7.0.00.0200.07020.11
5.6.280.0030.07321.14
5.6.210.0100.07320.66
5.6.200.0030.08718.12
5.6.190.0030.05720.39
5.6.180.3130.04020.77
5.6.170.0200.07020.49
5.6.160.0130.07720.38
5.6.150.0100.07718.22
5.6.140.0030.04718.23
5.6.130.0100.08018.17
5.6.120.0130.07721.00
5.6.110.0100.08020.99
5.6.100.0170.07321.02
5.6.90.0130.07020.96
5.6.80.0100.07020.50
5.6.70.4570.03320.27
5.5.350.0200.05320.40
5.5.340.0030.04317.93
5.5.330.0070.05320.29
5.5.320.0470.06720.20
5.5.310.0200.06720.16
5.5.300.0100.06318.02
5.5.290.0030.09017.87
5.5.280.0070.08320.87
5.5.270.0100.07320.67
5.5.260.0030.07720.89
5.5.250.0100.07020.54
5.5.240.0270.06320.36
5.4.450.0030.07019.41
5.4.440.0030.08319.47
5.4.430.0070.05719.20
5.4.420.0100.04719.54
5.4.410.0070.07019.38
5.4.400.0070.04318.79
5.4.390.0100.07318.80
5.4.380.0070.06718.79
5.4.370.0130.06719.14
5.4.360.0100.07319.09
5.4.350.0030.04019.18
5.4.340.0100.04718.79
5.4.320.0030.04719.00
5.4.310.0130.04019.14
5.4.300.0070.06319.18
5.4.290.0130.04019.00
5.4.280.0100.03319.14
5.4.270.0070.04019.09
5.4.260.0030.03719.00
5.4.250.0070.03319.17
5.4.240.0030.03718.78
5.4.230.0030.03719.16
5.4.220.0070.03319.17
5.4.210.0070.03319.17
5.4.200.0000.04019.00
5.4.190.0070.03319.11
5.4.180.0100.03318.81
5.4.170.0070.03719.07
5.4.160.0030.03719.05
5.4.150.0030.03719.12
5.4.140.0100.03716.25
5.4.130.0030.03316.33
5.4.120.0070.03316.37
5.4.110.0100.02716.33
5.4.100.0000.04016.32
5.4.90.0000.04016.37
5.4.80.0000.03716.38
5.4.70.0070.03316.27
5.4.60.0000.03716.32
5.4.50.0030.03316.21
5.4.40.0030.03716.21
5.4.30.0030.03316.20
5.4.20.0030.03316.23
5.4.10.0030.03316.20
5.4.00.0000.03715.81
5.3.290.0070.06014.64
5.3.280.0000.04014.52
5.3.270.0030.03714.53
5.3.260.0030.03714.53
5.3.250.0030.03714.54
5.3.240.0030.03714.69
5.3.230.0030.03714.61
5.3.220.0000.04014.52
5.3.210.0030.05014.55
5.3.200.0070.03314.35
5.3.190.0030.03714.51
5.3.180.0030.04014.52
5.3.170.0000.04014.50
5.3.160.0000.03714.54
5.3.150.0030.03714.58
5.3.140.0000.04014.47
5.3.130.0030.04714.33
5.3.120.0030.04014.50
5.3.110.0070.03314.51
5.3.100.0100.03013.93
5.3.90.0000.03714.00
5.3.80.0000.04013.83
5.3.70.0000.04013.95
5.3.60.0070.03013.94
5.3.50.0070.06313.76
5.3.40.0000.04313.88
5.3.30.0100.07013.77
5.3.20.0030.04713.48
5.3.10.0070.06713.59
5.3.00.0030.05013.45
5.2.170.0030.04711.11
5.2.160.0070.04710.98
5.2.150.0070.04311.02
5.2.140.0070.03711.29
5.2.130.0070.02711.09
5.2.120.0030.03011.07
5.2.110.0130.02711.11
5.2.100.0070.05311.05
5.2.90.0030.06311.04
5.2.80.0070.06010.99
5.2.70.0000.06011.08
5.2.60.0070.05010.96
5.2.50.0030.04010.91
5.2.40.0070.06310.97
5.2.30.0070.06310.90
5.2.20.0030.02710.94
5.2.10.0070.02710.81
5.2.00.0030.06310.75
5.1.60.0070.05310.05
5.1.50.0030.0579.89
5.1.40.0030.0539.88
5.1.30.0030.03010.40
5.1.20.0000.06010.35
5.1.10.0000.03010.02
5.1.00.0000.03310.10
5.0.50.0000.0378.62
5.0.40.0100.0408.62
5.0.30.0030.0678.62
5.0.20.0070.0408.62
5.0.10.0030.0478.62
5.0.00.0030.0608.62
4.4.90.0070.0278.62
4.4.80.0000.0378.62
4.4.70.0030.0208.62
4.4.60.0070.0178.62
4.4.50.0030.0338.62
4.4.40.0000.0478.62
4.4.30.0000.0208.62
4.4.20.0100.0108.62
4.4.10.0000.0208.62
4.4.00.0070.0508.62
4.3.110.0030.0238.62
4.3.100.0000.0338.62
4.3.90.0030.0338.62
4.3.80.0100.0308.62
4.3.70.0030.0178.62
4.3.60.0000.0338.62
4.3.50.0070.0338.62
4.3.40.0070.0478.62
4.3.30.0000.0408.62
4.3.20.0030.0278.62
4.3.10.0000.0378.62
4.3.00.0000.0338.62

preferences:
60.29 ms | 401 KiB | 5 Q