3v4l.org

run code in 300+ PHP versions simultaneously
<?php function endsWith($haystack, $needle) { return $needle === '' || substr_compare($haystack, $needle, -strlen($needle), strlen($needle)) === 0; } var_dump(endsWith('foobar', 'bar')); var_dump(endsWith('foobar', 'foo')); var_dump(endsWith('foobar', 'foobar')); var_dump(endsWith('foobar', 'foobarbaz')); var_dump(endsWith('foobar', 'xfoobar')); var_dump(endsWith('', '')); var_dump(endsWith('foo', '')); var_dump(endsWith('', 'foo'));

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.40.0150.00018.71
8.3.30.0110.00319.15
8.3.20.0000.00820.13
8.3.10.0050.00320.36
8.3.00.0080.00019.25
8.2.170.0110.00422.96
8.2.160.0140.00020.47
8.2.150.0030.00624.18
8.2.140.0110.00724.66
8.2.130.0030.00526.16
8.2.120.0080.00022.26
8.2.110.0030.00622.30
8.2.100.0040.00819.46
8.2.90.0050.00319.07
8.2.80.0040.00417.97
8.2.70.0060.00317.38
8.2.60.0080.00017.80
8.2.50.0040.00418.07
8.2.40.0090.00017.97
8.2.30.0070.00017.88
8.2.20.0040.00417.65
8.2.10.0050.00217.88
8.2.00.0050.00317.50
8.1.270.0060.00321.98
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00523.91
8.1.230.0080.00319.15
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0030.00518.48
8.1.160.0040.00422.00
8.1.150.0070.00018.83
8.1.140.0000.00717.44
8.1.130.0000.00817.72
8.1.120.0000.00717.34
8.1.110.0040.00617.45
8.1.100.0040.00417.39
8.1.90.0030.00317.40
8.1.80.0070.00017.38
8.1.70.0030.00317.37
8.1.60.0000.01217.46
8.1.50.0040.00417.39
8.1.40.0000.00817.47
8.1.30.0080.00017.46
8.1.20.0000.00817.60
8.1.10.0050.00317.39
8.1.00.0030.00617.36
8.0.300.0030.00518.77
8.0.290.0070.00016.75
8.0.280.0040.00318.44
8.0.270.0000.00817.24
8.0.260.0030.00517.20
8.0.250.0000.00716.77
8.0.240.0000.00616.79
8.0.230.0030.00316.76
8.0.220.0070.00016.74
8.0.210.0000.00716.88
8.0.200.0030.00316.88
8.0.190.0060.00316.95
8.0.180.0070.00016.79
8.0.170.0080.00016.95
8.0.160.0000.00716.73
8.0.150.0070.00016.68
8.0.140.0040.00416.77
8.0.130.0000.00613.30
8.0.120.0000.00716.82
8.0.110.0050.00316.65
8.0.100.0000.00716.79
8.0.90.0000.00716.73
8.0.80.0060.00916.88
8.0.70.0070.00016.85
8.0.60.0040.00416.78
8.0.50.0040.00416.65
8.0.30.0100.00917.11
8.0.20.0030.01517.40
8.0.10.0000.00716.91
8.0.00.0090.01216.78
7.4.330.0000.00515.13
7.4.320.0030.00316.42
7.4.300.0030.00316.45
7.4.290.0030.00316.52
7.4.280.0040.00416.45
7.4.270.0000.00616.57
7.4.260.0000.00716.50
7.4.250.0050.00216.41
7.4.240.0030.00516.47
7.4.230.0000.00716.48
7.4.220.0090.01816.57
7.4.210.0140.00716.54
7.4.200.0070.00016.36
7.4.160.0110.00516.40
7.4.150.0100.01017.40
7.4.140.0130.00917.86
7.4.130.0100.01316.46
7.4.120.0120.00716.39
7.4.110.0070.01016.36
7.4.100.0060.01116.29
7.4.90.0110.00616.50
7.4.80.0100.00719.39
7.4.70.0160.00316.52
7.4.60.0100.00616.41
7.4.50.0000.00816.21
7.4.40.0120.00916.32
7.4.30.0030.01516.56
7.4.00.0020.01114.75
7.3.330.0000.00513.22
7.3.320.0030.00313.29
7.3.310.0040.00416.20
7.3.300.0030.00316.32
7.3.290.0110.00316.28
7.3.280.0090.00816.29
7.3.270.0100.00917.40
7.3.260.0120.00616.43
7.3.250.0090.00916.38
7.3.240.0090.00916.29
7.3.230.0160.00316.39
7.3.210.0000.01716.34
7.3.200.0110.00819.39
7.3.190.0060.01816.48
7.3.180.0090.00616.36
7.3.170.0120.00416.48
7.3.160.0140.00316.57
7.3.120.0020.01614.82
7.3.110.0080.00914.88
7.3.100.0070.01014.71
7.3.90.0030.00714.75
7.3.80.0060.01014.77
7.3.70.0050.01014.89
7.3.60.0060.00614.66
7.3.50.0030.00814.91
7.3.40.0030.01114.89
7.3.30.0030.00814.71
7.3.20.0050.00616.78
7.3.10.0060.00816.78
7.3.00.0080.00616.57
7.2.330.0100.00716.80
7.2.320.0120.00616.63
7.2.310.0110.00716.62
7.2.300.0030.01316.44
7.2.290.0150.00316.45
7.2.250.0080.01014.97
7.2.240.0100.00814.93
7.2.230.0050.01015.16
7.2.220.0050.00815.01
7.2.210.0040.01014.79
7.2.200.0070.00815.12
7.2.190.0030.01415.02
7.2.180.0040.00714.97
7.2.170.0050.00714.81
7.2.00.0030.01019.53
7.1.330.0080.00615.83
7.1.320.0030.01115.84
7.1.310.0110.00415.64
7.1.300.0030.00815.66
7.1.290.0070.00515.69
7.1.280.0000.01415.81
7.1.270.0060.00615.81
7.1.260.0050.00815.84
7.1.100.0030.00518.17
7.1.70.0050.00216.89
7.1.60.0070.01319.32
7.1.50.0100.01016.74
7.1.00.0070.07322.34
7.0.200.0040.00416.68
7.0.140.0100.06322.11
7.0.60.0170.06319.94
7.0.50.0070.06317.89
7.0.40.0130.04720.11
7.0.30.0230.07320.20
7.0.20.0270.05320.19
7.0.10.0030.08020.24
7.0.00.0100.07020.06
5.6.280.0100.06721.10
5.6.210.0070.07320.51
5.6.200.0170.07718.22
5.6.190.0070.05320.39
5.6.180.0230.08020.50
5.6.170.0170.04320.54
5.6.160.0000.07020.57
5.6.150.0030.08318.27
5.6.140.0030.06018.23
5.6.130.0070.08718.14
5.6.120.0130.06721.00
5.6.110.0130.03321.00
5.6.100.0100.08021.00
5.6.90.0070.08320.88
5.6.80.0100.07720.38
5.5.350.0270.05720.41
5.5.340.0070.07717.93
5.5.330.0100.06320.45
5.5.320.0470.07020.27
5.5.310.0170.04020.30
5.5.300.0000.04718.05
5.5.290.0000.06717.95
5.5.280.0100.08020.77
5.5.270.0000.04320.79
5.5.260.0070.06720.96
5.5.250.0030.07320.71
5.5.240.0330.05720.27
5.4.450.0200.04719.16
5.4.440.0200.03319.33
5.4.430.0270.03319.31
5.4.420.0300.03019.41
5.4.410.0230.04019.41
5.4.400.0300.06719.32
5.4.390.0230.03719.14
5.4.380.0370.03318.85
5.4.370.0270.06719.13
5.4.360.0300.03718.87
5.4.350.0270.04318.95
5.4.340.0300.05019.07
5.4.320.0270.04319.22
5.4.310.0200.04019.08
5.4.300.0270.03719.31
5.4.290.0230.03718.87
5.4.280.0270.03318.96
5.4.270.0400.03719.13
5.4.260.0200.04318.99
5.4.250.0270.03318.97
5.4.240.0430.03319.22
5.4.230.0270.03319.08
5.4.220.0300.03019.21
5.4.210.0300.04718.94
5.4.200.0300.03019.07
5.4.190.0270.03718.99
5.4.180.0230.03719.16
5.4.170.0270.04719.06
5.4.160.0200.04018.92
5.4.150.0270.05319.05
5.4.140.0270.03716.35
5.4.130.0300.05316.45
5.4.120.0370.03016.38
5.4.110.0400.03016.45
5.4.100.0270.03316.53
5.4.90.0270.03316.54
5.4.80.0230.03316.26
5.4.70.0370.05716.24
5.4.60.0230.03316.52
5.4.50.0300.03716.37
5.4.40.0270.03316.43
5.4.30.0270.04016.32
5.4.20.0230.04016.53
5.4.10.0330.06316.51
5.4.00.0230.03715.73
5.3.290.0270.03714.58
5.3.280.0200.04014.51
5.3.270.0230.04014.61
5.3.260.0200.04014.66
5.3.250.0300.03314.50
5.3.240.0270.04014.57
5.3.230.0230.04014.60
5.3.220.0230.04014.57
5.3.210.0230.04314.57
5.3.200.0300.03714.58
5.3.190.0330.06714.60
5.3.180.0270.04314.57
5.3.170.0270.03314.55
5.3.160.0200.04014.55
5.3.150.0270.04714.56
5.3.140.0300.04314.64
5.3.130.0270.04714.60
5.3.120.0300.04714.47
5.3.110.0370.03714.63
5.3.100.0270.03313.95
5.3.90.0270.03313.93
5.3.80.0370.04713.93
5.3.70.0230.03714.11
5.3.60.0370.03314.16
5.3.50.0230.03713.93
5.3.40.0300.03013.93
5.3.30.0230.03713.81
5.3.20.0270.03013.60
5.3.10.0230.05013.66
5.3.00.0230.03313.54
5.2.170.0200.03011.08
5.2.160.0170.03011.10
5.2.150.0300.03311.31
5.2.140.0230.02311.19
5.2.130.0130.03311.11
5.2.120.0170.03011.16
5.2.110.0200.02711.18
5.2.100.0200.03311.03
5.2.90.0170.03011.22
5.2.80.0170.03011.11
5.2.70.0170.03311.00
5.2.60.0170.03010.97
5.2.50.0200.03011.17
5.2.40.0170.03010.92
5.2.30.0170.03310.87
5.2.20.0170.05310.96
5.2.10.0200.04010.83
5.2.00.0230.05310.63
5.1.60.0230.02010.15
5.1.50.0200.02310.08
5.1.40.0200.02310.21
5.1.30.0200.02010.43
5.1.20.0130.02710.32
5.1.10.0130.02710.29
5.1.00.0200.03010.07
5.0.50.0130.0238.46
5.0.40.0130.0208.49
5.0.30.0100.0338.16
5.0.20.0130.0208.36
5.0.10.0170.0178.25
5.0.00.0130.0308.16
4.4.90.0100.0177.57
4.4.80.0130.0107.57
4.4.70.0070.0177.57
4.4.60.0100.0177.57
4.4.50.0130.0137.57
4.4.40.0100.0307.57
4.4.30.0100.0237.57
4.4.20.0130.0137.57
4.4.10.0070.0207.57
4.4.00.0070.0277.57
4.3.110.0130.0137.57
4.3.100.0070.0177.57
4.3.90.0030.0207.57
4.3.80.0100.0237.57
4.3.70.0130.0107.57
4.3.60.0030.0207.57
4.3.50.0100.0137.57
4.3.40.0100.0237.57
4.3.30.0100.0277.57
4.3.20.0030.0177.57
4.3.10.0070.0207.57
4.3.00.0030.0177.57

preferences:
38.63 ms | 400 KiB | 5 Q