3v4l.org

run code in 300+ PHP versions simultaneously
<?php function endswith($string, $test) { $strlen = strlen($string); $testlen = strlen($test); if ($testlen > $strlen) return false; return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0; } if (version_compare(phpversion(), '5.1.5', '>=')) { var_dump(endswith("abcdefg", "abc")); var_dump(endswith("abcdefg", "efg")); }

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)
7.3.120.0070.01114.77
7.3.110.0070.01014.88
7.3.100.0080.00814.49
7.3.90.0090.00614.85
7.3.80.0100.00614.80
7.3.70.0030.01014.64
7.3.60.0110.00414.97
7.3.50.0090.00614.74
7.3.40.0030.00914.79
7.3.30.0070.01014.70
7.3.20.0000.01216.82
7.3.10.0110.00016.89
7.3.00.0030.01016.63
7.2.240.0070.01015.01
7.2.230.0090.00614.82
7.2.220.0050.00514.95
7.2.210.0050.00515.14
7.2.200.0030.01114.79
7.2.190.0030.01314.98
7.2.180.0130.00314.85
7.2.170.0040.01514.81
7.2.160.0000.01515.00
7.2.150.0000.01316.55
7.2.140.0080.00716.89
7.2.130.0000.01416.77
7.2.120.0090.00616.67
7.2.110.0060.00316.70
7.2.100.0060.00916.85
7.2.90.0060.00616.82
7.2.80.0030.01216.98
7.2.70.0060.00316.68
7.2.60.0120.00016.79
7.2.50.0100.00316.70
7.2.40.0040.00716.69
7.2.30.0030.01216.88
7.2.20.0060.01016.69
7.2.10.0040.01116.95
7.2.00.0050.00918.14
7.1.330.0070.01115.79
7.1.320.0090.00015.85
7.1.310.0070.01015.88
7.1.300.0040.01115.82
7.1.290.0040.00715.73
7.1.280.0090.00615.94
7.1.270.0090.00015.80
7.1.260.0030.00615.99
7.1.250.0030.00915.56
7.1.100.0060.00617.73
7.1.70.0100.00017.21
7.1.60.0100.01419.70
7.1.50.0170.00716.69
7.1.00.0000.07722.54
7.0.200.0030.00616.87
7.0.140.0000.07721.99
7.0.60.0100.07719.87
7.0.50.0100.05017.98
7.0.40.0070.04320.40
7.0.30.0270.06020.30
7.0.20.0230.07320.23
7.0.10.0030.08320.19
7.0.00.0100.03720.23
5.6.280.0030.07321.08
5.6.210.0100.03720.61
5.6.200.0130.07318.19
5.6.190.0030.07720.34
5.6.180.0100.04720.54
5.6.170.0300.03720.52
5.6.160.0070.07720.52
5.6.150.0000.04318.12
5.6.140.0100.03318.14
5.6.130.0030.04318.22
5.6.120.0100.08321.02
5.6.110.0130.08020.99
5.6.100.0030.08321.00
5.6.90.0070.04721.02
5.6.80.0030.08020.29
5.5.350.0170.05320.33
5.5.340.0070.08717.98
5.5.330.0100.03720.13
5.5.320.0270.07320.38
5.5.310.0200.04320.34
5.5.300.0030.04717.98
5.5.290.0130.07017.92
5.5.280.0030.09020.89
5.5.270.0070.05320.64
5.5.260.0100.08020.77
5.5.250.0130.07720.68
5.5.240.0000.03720.26
5.4.450.0100.06319.42
5.4.440.0070.08319.52
5.4.430.0900.05719.27
5.4.420.1730.04319.46
5.4.410.1800.04719.28
5.4.400.1200.04719.31
5.4.390.0070.07318.87
5.4.380.0100.04718.87
5.4.370.0030.03719.16
5.4.360.1500.05018.95
5.4.350.1930.03019.13
5.4.340.1930.04018.87
5.4.320.1800.04719.21
5.4.310.1600.03719.12
5.4.300.1830.03719.00
5.4.290.1830.04318.86
5.4.280.1900.04018.98
5.4.270.1830.04319.09
5.4.260.1800.04018.89
5.4.250.1800.04319.30
5.4.240.1770.04319.21
5.4.230.1830.03319.21
5.4.220.1830.03719.23
5.4.210.1600.03719.18
5.4.200.1730.04719.18
5.4.190.1800.04719.08
5.4.180.1770.03719.08
5.4.170.1830.04019.07
5.4.160.1630.03718.93
5.4.150.1630.03719.06
5.4.140.1630.03316.52
5.4.130.1830.04716.30
5.4.120.1670.03316.51
5.4.110.1670.03716.45
5.4.100.1800.02716.36
5.4.90.1770.04316.55
5.4.80.1630.03316.34
5.4.70.1900.03716.44
5.4.60.1900.03016.52
5.4.50.1630.03716.52
5.4.40.1670.03316.38
5.4.30.1830.03316.51
5.4.20.1670.03716.39
5.4.10.1670.03316.24
5.4.00.1600.03715.93
5.3.290.1530.03714.58
5.3.280.1630.04014.56
5.3.270.1670.04014.57
5.3.260.1370.04714.57
5.3.250.0070.03314.62
5.3.240.0030.06714.62
5.3.230.0100.03014.57
5.3.220.1370.03314.65
5.3.210.2130.03314.58
5.3.200.1970.03714.55
5.3.190.1800.03714.57
5.3.180.1630.04014.57
5.3.170.1730.04314.50
5.3.160.1800.04014.64
5.3.150.1530.04314.68
5.3.140.1570.04014.65
5.3.130.1470.04014.61
5.3.120.1570.04014.47
5.3.110.1430.04314.77
5.3.100.1670.03313.96
5.3.90.1630.04013.99
5.3.80.1600.03313.95
5.3.70.1530.02714.16
5.3.60.1530.04313.91
5.3.50.1630.03014.00
5.3.40.1630.03313.98
5.3.30.1670.03013.92
5.3.20.1570.03713.60
5.3.10.1670.03013.68
5.3.00.1630.03313.54
5.2.170.1200.03011.20
5.2.160.1370.03311.16
5.2.150.1330.03711.08
5.2.140.1370.02711.12
5.2.130.1330.02711.11
5.2.120.0600.03011.25
5.2.110.0030.02711.02
5.2.100.0030.03011.03
5.2.90.0870.02311.33
5.2.80.1530.03011.05
5.2.70.1270.03711.07
5.2.60.1570.03011.13
5.2.50.1600.02710.94
5.2.40.1270.03011.11
5.2.30.1100.03010.89
5.2.20.1100.02711.18
5.2.10.1170.02710.95
5.2.00.1000.03310.95
5.1.60.1300.03310.15
5.1.50.1200.02710.08
5.1.40.1030.0239.96
5.1.30.1270.03710.24
5.1.20.1070.02310.25
5.1.10.1000.03010.05
5.1.00.1270.03310.12
5.0.50.0500.0238.61
5.0.40.0570.0178.61
5.0.30.0600.0278.61
5.0.20.0700.0308.61
5.0.10.0600.0278.61
5.0.00.0630.0378.61
4.4.90.0800.0278.61
4.4.80.0800.0208.61
4.4.70.0770.0238.61
4.4.60.0670.0178.61
4.4.50.0670.0238.61
4.4.40.0630.0208.61
4.4.30.0600.0208.61
4.4.20.0670.0178.61
4.4.10.0630.0078.61
4.4.00.0670.0378.61
4.3.110.0530.0178.61
4.3.100.0630.0178.61
4.3.90.0630.0178.61
4.3.80.0630.0278.61
4.3.70.0600.0178.61
4.3.60.0630.0178.61
4.3.50.0530.0178.61
4.3.40.0500.0278.61
4.3.30.0370.0138.61
4.3.20.0300.0208.61
4.3.10.0300.0138.61
4.3.00.0270.0178.61

preferences:
40.78 ms | 400 KiB | 5 Q