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", "defg")); }

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.0000.01319.40
7.1.100.0030.00917.79
7.1.70.0070.00017.18
7.1.60.0100.01319.46
7.1.50.0110.01416.99
7.1.00.0070.07322.36
7.0.200.0120.00014.96
7.0.140.0000.07022.01
7.0.60.0070.06720.06
7.0.50.0000.09017.96
7.0.40.0170.06320.20
7.0.30.0200.05020.09
7.0.20.0270.07320.06
7.0.10.0130.08320.10
7.0.00.0130.07020.25
5.6.280.0070.07021.11
5.6.210.0200.05720.67
5.6.200.0100.08318.30
5.6.190.0130.08020.42
5.6.180.0130.08020.64
5.6.170.0200.05020.55
5.6.160.0100.07320.50
5.6.150.0130.07318.29
5.6.140.0130.07018.29
5.6.130.0070.06718.30
5.6.120.0170.07721.14
5.6.110.0100.08021.01
5.6.100.0100.07721.09
5.6.90.0100.07720.98
5.6.80.0130.07320.38
5.5.350.4270.04320.47
5.5.340.0070.08017.98
5.5.330.0170.06320.41
5.5.320.0230.05320.30
5.5.310.0200.04320.37
5.5.300.0070.07717.95
5.5.290.0030.05717.99
5.5.280.0070.04020.98
5.5.270.0100.06720.80
5.5.260.0070.08320.84
5.5.250.0030.04320.55
5.5.240.0300.06020.07
5.4.450.0100.06719.54
5.4.440.0630.06319.68
5.4.430.0030.06019.21
5.4.420.0170.05019.53
5.4.410.0070.05719.10
5.4.400.0130.05019.23
5.4.390.0170.05718.63
5.4.380.0170.06318.72
5.4.370.0200.07018.73
5.4.360.0200.07318.70
5.4.350.0270.06718.79
5.4.340.0130.05718.76
5.4.320.0300.04718.54
5.4.310.0430.04318.46
5.4.300.0070.07718.52
5.4.290.0300.04718.46
5.4.280.0270.06018.70
5.4.270.0270.05318.46
5.4.260.0230.06718.46
5.4.250.0200.06318.46
5.4.240.0330.05318.62
5.4.230.0200.06018.48
5.4.220.0130.06018.71
5.4.210.0200.06318.51
5.4.200.0300.06016.52
5.4.190.0170.06018.54
5.4.180.0230.05718.61
5.4.170.0330.05318.77
5.4.160.0230.07318.77
5.4.150.0230.06718.55
5.4.140.0200.07316.24
5.4.130.0200.05016.17
5.4.120.0200.07016.15
5.4.110.0200.06016.21
5.4.100.0200.06316.19
5.4.90.0230.06716.28
5.4.80.0300.05716.22
5.4.70.0300.05016.25
5.4.60.0170.05016.21
5.4.50.0200.05016.20
5.4.40.0300.04716.16
5.4.30.0100.05316.25
5.4.20.0230.05016.15
5.4.10.0330.04016.30
5.4.00.0270.04315.72
5.3.290.0200.07314.63
5.3.280.0030.06714.58
5.3.270.0170.05314.64
5.3.260.0230.05014.73
5.3.250.0170.05314.80
5.3.240.0330.05314.64
5.3.230.0200.06714.62
5.3.220.0230.06714.58
5.3.210.0300.06314.66
5.3.200.0200.05014.72
5.3.190.0070.07014.66
5.3.180.0100.06314.64
5.3.170.0130.05314.67
5.3.160.0100.06014.61
5.3.150.0130.06014.68
5.3.140.0130.05314.65
5.3.130.0170.05714.57
5.3.120.0330.06314.58
5.3.110.0200.07014.52
5.3.100.0200.05314.24
5.3.90.0300.05714.20
5.3.80.0300.06014.04
5.3.70.0200.06014.21
5.3.60.0200.05714.00
5.3.50.0270.04314.07
5.3.40.0300.05714.08
5.3.30.0230.04713.95
5.3.20.0230.05313.88
5.3.10.0200.05313.67
5.3.00.0170.06313.75
5.2.170.0270.04711.24
5.2.160.0200.05011.26
5.2.150.0200.04711.18
5.2.140.0130.05011.26
5.2.130.0170.04011.30
5.2.120.0130.05011.18
5.2.110.0130.05711.18
5.2.100.0200.05311.18
5.2.90.0130.06011.19
5.2.80.0200.04311.19
5.2.70.0170.05011.18
5.2.60.0130.05011.18
5.2.50.0100.04711.18
5.2.40.0170.04011.18
5.2.30.0100.04311.18
5.2.20.0170.04011.18
5.2.10.0170.03711.18
5.2.00.0100.05711.18
5.1.60.0000.06011.18
5.1.50.0100.03711.18
5.1.40.0130.03311.18
5.1.30.0130.05011.18
5.1.20.0100.05011.18
5.1.10.0270.02311.18
5.1.00.0130.04711.18
5.0.50.0000.04011.18
5.0.40.0130.02711.18
5.0.30.0100.04311.18
5.0.20.0070.03011.18
5.0.10.0130.02311.18
5.0.00.0070.04311.18
4.4.90.0070.03011.18
4.4.80.0130.01711.18
4.4.70.0070.02011.18
4.4.60.0070.02011.18
4.4.50.0070.02011.18
4.4.40.0030.03711.18
4.4.30.0000.02711.18
4.4.20.0100.02311.18
4.4.10.0030.03311.18
4.4.00.0130.03311.18
4.3.110.0070.02711.18
4.3.100.0070.02011.18
4.3.90.0030.02311.18
4.3.80.0070.03311.18
4.3.70.0100.01711.18
4.3.60.0030.03311.18
4.3.50.0130.02311.18
4.3.40.0070.04311.18
4.3.30.0070.02711.18
4.3.20.0000.03311.18
4.3.10.0070.02311.18
4.3.00.0070.0209.24

preferences:
35.84 ms | 400 KiB | 5 Q