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-1) === 0; } if (version_compare(phpversion(), '5.1.0', '>=')) { 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.4.10.0060.01214.88
7.4.00.0120.00015.06
7.3.130.0000.01314.70
7.3.120.0090.00614.80
7.3.110.0030.01314.69
7.3.100.0050.00814.65
7.3.90.0000.01414.48
7.3.80.0030.00715.09
7.3.70.0070.00714.86
7.3.60.0090.00014.84
7.3.50.0030.00614.89
7.3.40.0030.00514.77
7.3.30.0030.01014.76
7.3.20.0030.00916.42
7.3.10.0060.00716.59
7.3.00.0080.00716.53
7.2.260.0090.00914.82
7.2.250.0070.01014.64
7.2.240.0030.01414.72
7.2.230.0030.01315.15
7.2.220.0030.01314.74
7.2.210.0060.00914.84
7.2.200.0030.00615.02
7.2.190.0100.00314.96
7.2.180.0120.00315.08
7.2.170.0040.01114.99
7.2.160.0030.00614.90
7.2.150.0060.00916.77
7.2.140.0060.00916.92
7.2.130.0070.00516.57
7.2.120.0040.01016.58
7.2.110.0060.00516.82
7.2.100.0050.00616.62
7.2.90.0070.00516.66
7.2.80.0060.00816.81
7.2.70.0030.01016.84
7.2.60.0030.00816.74
7.2.50.0060.00816.71
7.2.40.0050.00716.76
7.2.30.0100.00516.89
7.2.20.0050.01016.81
7.2.10.0050.01016.79
7.2.00.0080.00317.71
7.1.330.0100.00315.93
7.1.320.0040.01115.79
7.1.310.0070.00715.69
7.1.300.0070.00715.90
7.1.290.0060.00315.75
7.1.280.0090.00615.52
7.1.270.0040.00815.84
7.1.260.0070.00715.53
7.1.250.0020.00915.68
7.1.240.0000.01015.95
7.1.230.0030.01015.75
7.1.220.0110.00415.95
7.1.210.0030.01015.76
7.1.200.0050.00515.94
7.1.190.0000.00915.98
7.1.180.0100.00315.80
7.1.170.0030.01015.96
7.1.160.0030.00715.72
7.1.150.0080.00015.55
7.1.140.0070.00715.85
7.1.130.0030.00615.75
7.1.120.0000.00815.88
7.1.110.0030.01015.55
7.1.100.0000.01016.84
7.1.90.0030.01415.86
7.1.80.0030.01015.82
7.1.70.0040.00616.48
7.1.60.0080.01117.77
7.1.50.0090.01016.24
7.1.40.0000.01815.75
7.1.30.0110.00415.93
7.1.20.0060.01015.82
7.1.10.0110.00415.93
7.1.00.0030.04319.13
7.0.330.0000.01215.51
7.0.320.0040.00715.36
7.0.310.0040.01115.43
7.0.300.0030.00515.33
7.0.290.0100.00315.18
7.0.280.0070.00315.55
7.0.270.0070.00715.15
7.0.260.0030.01315.45
7.0.250.0040.01115.51
7.0.240.0060.00315.53
7.0.230.0100.00315.19
7.0.220.0060.00615.59
7.0.210.0080.00015.45
7.0.200.0040.00916.00
7.0.190.0070.01115.55
7.0.180.0040.00415.62
7.0.170.0110.00015.23
7.0.160.0000.01415.57
7.0.150.0060.00615.47
7.0.140.0050.04118.78
7.0.130.0040.01115.59
7.0.120.0100.00315.46
7.0.110.0070.00715.35
7.0.100.0040.00715.40
7.0.90.0060.00315.50
7.0.80.0070.00715.33
7.0.70.0090.00315.48
7.0.60.0080.03517.69
7.0.50.0070.03916.62
7.0.40.0080.02316.75
7.0.30.0210.03316.83
7.0.20.0170.02816.69
7.0.10.0080.02716.83
7.0.00.0110.04116.83
5.6.400.0070.00314.15
5.6.390.0100.00714.15
5.6.380.0060.00614.10
5.6.370.0090.00614.34
5.6.360.0000.01014.54
5.6.350.0070.00714.40
5.6.340.0030.01014.48
5.6.330.0000.00914.34
5.6.320.0080.00614.48
5.6.310.0040.00714.48
5.6.300.0000.01214.13
5.6.290.0070.00714.32
5.6.280.0100.03517.63
5.6.270.0000.00914.58
5.6.260.0070.00714.13
5.6.250.0000.01013.93
5.6.240.0060.00614.46
5.6.230.0080.00414.39
5.6.220.0030.01314.20
5.6.210.0050.02417.43
5.6.200.0030.04216.12
5.6.190.0060.03017.38
5.6.180.0100.02317.55
5.6.170.0150.02817.28
5.6.160.0050.04317.30
5.6.150.0020.02816.04
5.6.140.0100.01816.31
5.6.130.0050.04116.17
5.6.120.0080.02917.69
5.6.110.0070.04617.74
5.6.100.0090.04317.58
5.6.90.0070.02317.60
5.6.80.0120.03217.48
5.6.70.0090.00014.32
5.6.60.0040.00813.98
5.6.50.0030.01113.89
5.6.40.0120.00014.21
5.6.30.0100.00714.41
5.6.20.0120.00414.13
5.6.10.0100.00613.94
5.6.00.0030.01314.11
5.5.380.0070.01013.88
5.5.370.0060.00913.82
5.5.360.0090.00614.15
5.5.350.0160.04117.31
5.5.340.0070.04516.15
5.5.330.0060.02317.36
5.5.320.0150.02717.30
5.5.310.0150.02217.12
5.5.300.0110.02016.16
5.5.290.0070.02815.86
5.5.280.0050.04617.44
5.5.270.0030.04917.63
5.5.260.0060.04717.46
5.5.250.0070.03117.37
5.5.240.0040.04417.11
5.5.230.0110.00613.84
5.5.220.0050.00514.07
5.5.210.0060.00814.21
5.5.200.0070.00714.05
5.5.190.0040.01414.05
5.5.180.0040.00814.02
5.5.170.0030.00513.86
5.5.160.0030.01314.02
5.5.150.0070.00713.96
5.5.140.0070.00314.07
5.5.130.0070.00714.23
5.5.120.0040.00813.98
5.5.110.0060.00613.85
5.5.100.0040.00814.21
5.5.90.0090.00613.97
5.5.80.0060.00613.78
5.5.70.0070.01013.95
5.5.60.0090.00914.04
5.5.50.0070.01013.91
5.5.40.0040.00814.25
5.5.30.0000.01314.06
5.5.20.0030.01214.22
5.5.10.0000.01314.17
5.5.00.0120.00614.25
5.4.450.0400.03016.11
5.4.440.0080.03216.10
5.4.430.0120.03215.91
5.4.420.0070.03716.09
5.4.410.0030.03215.80
5.4.400.0240.03015.71
5.4.390.0120.03515.62
5.4.380.0080.02815.60
5.4.370.0130.02815.66
5.4.360.0250.01815.55
5.4.350.0050.02212.31
5.4.340.0040.02112.31
5.4.330.0050.00512.60
5.4.320.0060.01912.55
5.4.310.0050.02912.55
5.4.300.0040.02312.55
5.4.290.0050.02212.55
5.4.280.0070.02612.50
5.4.270.0070.02112.50
5.4.260.0050.02212.50
5.4.250.0020.02512.50
5.4.240.0030.02312.50
5.4.230.0040.02312.50
5.4.220.0040.02112.49
5.4.210.0070.02212.49
5.4.200.0040.02912.50
5.4.190.0060.02712.50
5.4.180.0060.02512.50
5.4.170.0060.02212.50
5.4.160.0050.02312.49
5.4.150.0090.02512.49
5.4.140.0060.02612.34
5.4.130.0080.02312.33
5.4.120.0060.02812.31
5.4.110.0090.02612.30
5.4.100.0060.02212.31
5.4.90.0080.02612.31
5.4.80.0090.02412.31
5.4.70.0060.02712.30
5.4.60.0040.02412.31
5.4.50.0080.01712.31
5.4.40.0060.02012.30
5.4.30.0030.02312.30
5.4.20.0080.02012.30
5.4.10.0040.02012.30
5.4.00.0060.02112.04
5.3.290.0070.03012.70
5.3.280.0070.02012.65
5.3.270.0060.02412.66
5.3.260.0040.02512.66
5.3.250.0030.02412.66
5.3.240.0120.01712.66
5.3.230.0070.02312.66
5.3.220.0090.02412.64
5.3.210.0020.03312.64
5.3.200.0020.02512.64
5.3.190.0070.02712.64
5.3.180.0070.02212.64
5.3.170.0100.01812.63
5.3.160.0060.02112.64
5.3.150.0070.02812.64
5.3.140.0040.02412.63
5.3.130.0040.02612.63
5.3.120.0040.02312.63
5.3.110.0070.02412.63
5.3.100.0050.02512.36
5.3.90.0070.01812.35
5.3.80.0040.02112.35
5.3.70.0080.01812.35
5.3.60.0020.02612.34
5.3.50.0060.02112.31
5.3.40.0050.02412.31
5.3.30.0050.02112.29
5.3.20.0030.02512.18
5.3.10.0070.05112.16
5.3.00.0050.03112.16
5.2.170.0090.0409.21
5.2.160.0090.0399.21
5.2.150.0090.0409.22
5.2.140.0110.0579.21
5.2.130.0150.0619.17
5.2.120.0100.0399.17
5.2.110.0090.0489.18
5.2.100.0150.0579.18
5.2.90.0070.0299.18
5.2.80.0060.0319.18
5.2.70.0070.0399.18
5.2.60.0060.0309.13
5.2.50.0090.0279.09
5.2.40.0120.0249.07
5.2.30.0040.0329.05
5.2.20.0060.0379.03
5.2.10.0070.0368.95
5.2.00.0030.0328.80
5.1.60.0040.0328.09
5.1.50.0140.0488.08
5.1.40.0180.0528.07
5.1.30.0080.0598.41
5.1.20.0070.0338.44
5.1.10.0050.0358.16
5.1.00.0080.0298.16
5.0.50.0080.0406.64
5.0.40.0060.0246.50
5.0.30.0030.0376.31
5.0.20.0030.0246.28
5.0.10.0050.0226.26
5.0.00.0030.0406.25
4.4.90.0060.0184.78
4.4.80.0080.0304.75
4.4.70.0030.0234.75
4.4.60.0040.0164.75
4.4.50.0000.0204.77
4.4.40.0010.0284.71
4.4.30.0060.0194.76
4.4.20.0040.0234.84
4.4.10.0050.0144.84
4.4.00.0030.0264.76
4.3.110.0040.0154.66
4.3.100.0020.0164.67
4.3.90.0030.0154.63
4.3.80.0040.0244.58
4.3.70.0020.0164.63
4.3.60.0030.0164.62
4.3.50.0070.0274.63
4.3.40.0020.0274.54
4.3.30.0030.0173.30
4.3.20.0030.0163.28
4.3.10.0030.0193.24
4.3.00.0170.0207.11

preferences:
36.01 ms | 400 KiB | 5 Q