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) === 0; } if (version_compare(phpversion(), '5.1.0', '>')) { var_dump(endswith("abcdefg", "abc")); }

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.2.00.0090.00319.29
7.1.100.0000.01318.13
7.1.70.0030.00316.92
7.1.60.0110.01419.46
7.1.50.0070.01716.74
7.1.00.0030.07722.57
7.0.200.0070.00415.05
7.0.140.0070.04321.97
7.0.60.0070.08720.02
7.0.50.0030.05317.87
7.0.40.0100.06020.35
7.0.30.0300.07020.23
7.0.20.0400.07320.23
7.0.10.0100.08020.17
7.0.00.0030.04720.15
5.6.280.0030.07720.91
5.6.210.0100.07720.71
5.6.200.0100.08018.12
5.6.190.0030.08720.48
5.6.180.0400.07720.61
5.6.170.0330.06720.50
5.6.160.0130.08020.50
5.6.150.0030.04018.27
5.6.140.0000.04018.27
5.6.130.0100.04318.16
5.6.120.0070.04721.02
5.6.110.0070.06320.98
5.6.100.0200.07020.96
5.6.90.0070.04021.02
5.6.80.0000.04020.39
5.5.350.0300.07020.36
5.5.340.0030.05717.95
5.5.330.0130.07020.35
5.5.320.0400.04020.25
5.5.310.0230.09320.23
5.5.300.0100.07718.02
5.5.290.0070.07718.09
5.5.280.0130.08020.85
5.5.270.0030.07320.95
5.5.260.0000.05020.68
5.5.250.0030.04720.49
5.5.240.0100.06720.12
5.4.450.0170.05719.41
5.4.440.0200.04719.17
5.4.430.0030.04019.32
5.4.420.0130.05019.40
5.4.410.0000.04019.19
5.4.400.0330.03019.21
5.4.390.0000.04019.02
5.4.380.0230.03719.31
5.4.370.2630.04719.09
5.4.360.2600.04019.06
5.4.350.0000.04719.32
5.4.340.0030.03718.95
5.4.320.0400.04019.22
5.4.310.0100.04319.08
5.4.300.0030.04719.19
5.4.290.1200.04319.06
5.4.280.2430.04019.21
5.4.270.2430.03319.22
5.4.260.0030.03719.01
5.4.250.0030.05719.08
5.4.240.0230.05018.98
5.4.230.0270.04018.87
5.4.220.0170.04319.15
5.4.210.0130.04019.21
5.4.200.0070.03719.13
5.4.190.0130.03318.98
5.4.180.0070.04319.20
5.4.170.0230.03018.83
5.4.160.0130.06018.98
5.4.150.0200.03318.93
5.4.140.0200.04016.39
5.4.130.0000.04716.66
5.4.120.0000.03716.37
5.4.110.0030.04316.19
5.4.100.2730.04716.45
5.4.90.2530.03016.25
5.4.80.2470.03016.19
5.4.70.2430.03316.46
5.4.60.2430.03316.53
5.4.50.0030.05716.43
5.4.40.0070.05716.34
5.4.30.0630.03016.53
5.4.20.2170.04016.38
5.4.10.0470.04016.16
5.4.00.0270.03315.84
5.3.290.0230.03314.89
5.3.280.0270.03314.66
5.3.270.0230.04014.50
5.3.260.0200.05314.52
5.3.250.0230.03314.61
5.3.240.0230.03314.59
5.3.230.0200.04314.68
5.3.220.0200.07314.48
5.3.210.0170.04014.65
5.3.200.0130.04014.55
5.3.190.0230.05014.53
5.3.180.0270.03314.71
5.3.170.0230.06314.48
5.3.160.0200.04014.47
5.3.150.0200.04314.47
5.3.140.0330.02714.54
5.3.130.0200.04014.60
5.3.120.0230.04014.45
5.3.110.0200.06014.55
5.3.100.0130.05314.13
5.3.90.0200.07713.99
5.3.80.0230.06314.07
5.3.70.0170.04713.92
5.3.60.0130.04014.15
5.3.50.0230.07014.09
5.3.40.0200.04313.85
5.3.30.0200.03314.00
5.3.20.0270.06313.76
5.3.10.0300.02313.74
5.3.00.0300.06013.61
5.2.170.0170.05011.12
5.2.160.0200.04011.27
5.2.150.0200.04011.22
5.2.140.0170.05711.05
5.2.130.0230.04011.16
5.2.120.0200.04311.22
5.2.110.0130.04011.11
5.2.100.0230.06011.18
5.2.90.0130.04711.16
5.2.80.0170.06311.07
5.2.70.0130.03011.00
5.2.60.0200.02311.16
5.2.50.0230.05711.24
5.2.40.0130.03311.07
5.2.30.0230.05310.89
5.2.20.0130.02711.01
5.2.10.0130.06310.95
5.2.00.0070.03710.62
5.1.60.0130.02310.12
5.1.50.0200.0479.89
5.1.40.0200.0409.84
5.1.30.0070.03310.31
5.1.20.0130.04310.57
5.1.10.0170.02010.00
5.1.00.0170.05710.17
5.0.50.0070.0408.60
5.0.40.0100.0208.39
5.0.30.0100.0608.11
5.0.20.0070.0278.13
5.0.10.0130.0338.15
5.0.00.0070.0338.29
4.4.90.0070.0207.91
4.4.80.0030.0207.91
4.4.70.0030.0177.91
4.4.60.0370.0277.91
4.4.50.0070.0177.91
4.4.40.0070.0377.91
4.4.30.0100.0177.91
4.4.20.0000.0207.91
4.4.10.0070.0177.91
4.4.00.0070.0277.91
4.3.110.0070.0177.91
4.3.100.0070.0137.91
4.3.90.0230.0277.91
4.3.80.0070.0437.91
4.3.70.0070.0177.91
4.3.60.0070.0377.91
4.3.50.0070.0177.91
4.3.40.0100.0477.91
4.3.30.0030.0177.91
4.3.20.0030.0407.91
4.3.10.0100.0207.91
4.3.00.0030.0237.91

preferences:
42.37 ms | 401 KiB | 5 Q