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, -$testlen) === 0; } if(false == endswith('http://localhost/events/10','/events/')){ echo 'true'; } else{ echo 'false'; } $testlen = strlen('/events/'); if(false == (substr_compare('http://localhost/events/10','/events/',-$testlen)===0)){ echo 'true'; } else{ echo 'false'; }

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.70.0060.01216.50
8.3.60.0090.00918.55
8.3.50.0100.01121.98
8.3.40.0040.01118.71
8.3.30.0080.00818.96
8.3.20.0070.00020.39
8.3.10.0080.00023.66
8.3.00.0000.00822.57
8.2.180.0150.00316.50
8.2.170.0140.00022.96
8.2.160.0090.00622.15
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0040.00419.48
8.2.110.0030.00622.08
8.2.100.0090.00317.72
8.2.90.0000.00819.17
8.2.80.0000.00817.97
8.2.70.0030.00617.38
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0070.00418.18
8.2.20.0000.00717.73
8.2.10.0070.00017.70
8.2.00.0060.00317.66
8.1.280.0060.01225.92
8.1.270.0090.00023.60
8.1.260.0000.00826.35
8.1.250.0090.00628.09
8.1.240.0040.00718.57
8.1.230.0030.00719.21
8.1.220.0030.00517.80
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0000.00817.41
8.1.180.0030.00518.10
8.1.170.0030.00518.56
8.1.160.0040.00422.06
8.1.150.0000.00718.66
8.1.140.0080.00017.38
8.1.130.0030.00317.79
8.1.120.0050.00517.50
8.1.110.0050.00317.47
8.1.100.0000.00717.45
8.1.90.0040.00417.44
8.1.80.0040.00417.35
8.1.70.0070.00017.44
8.1.60.0030.00517.62
8.1.50.0040.00417.43
8.1.40.0040.00417.51
8.1.30.0040.00417.59
8.1.20.0090.00017.62
8.1.10.0000.00817.50
8.1.00.0040.00417.51
8.0.300.0040.00419.05
8.0.290.0000.00817.18
8.0.280.0000.00718.45
8.0.270.0000.00717.14
8.0.260.0050.00316.79
8.0.250.0070.00016.88
8.0.240.0040.00416.95
8.0.230.0000.00717.00
8.0.220.0030.00316.77
8.0.210.0000.00716.83
8.0.200.0000.00616.98
8.0.190.0040.00416.89
8.0.180.0050.00516.89
8.0.170.0030.00516.97
8.0.160.0040.00416.80
8.0.150.0070.00016.97
8.0.140.0040.00416.79
8.0.130.0070.00013.31
8.0.120.0040.00416.84
8.0.110.0070.00016.79
8.0.100.0080.00016.79
8.0.90.0000.00716.96
8.0.80.0080.00816.92
8.0.70.0000.00716.79
8.0.60.0000.00716.90
8.0.50.0000.00716.79
8.0.30.0100.01217.13
8.0.20.0120.00717.40
8.0.10.0040.00417.07
8.0.00.0090.01616.80
7.4.330.0030.00315.09
7.4.320.0070.00016.66
7.4.300.0080.00016.62
7.4.290.0000.00716.46
7.4.280.0000.00716.59
7.4.270.0000.00916.48
7.4.260.0000.00716.55
7.4.250.0050.00216.43
7.4.240.0060.00216.48
7.4.230.0000.00716.37
7.4.220.0070.01116.57
7.4.210.0080.00816.57
7.4.200.0000.00716.57
7.4.190.0020.00516.68
7.4.160.0060.00916.40
7.4.150.0070.01017.40
7.4.140.0080.01017.86
7.4.130.0110.00916.49
7.4.120.0030.01316.45
7.4.110.0060.01116.38
7.4.100.0110.00616.54
7.4.90.0140.00316.59
7.4.80.0060.01516.59
7.4.70.0070.01016.57
7.4.60.0120.00316.57
7.4.50.0080.00016.64
7.4.40.0090.00922.77
7.4.30.0120.01016.50
7.4.00.0060.00615.07
7.3.330.0050.00013.46
7.3.320.0050.00013.30
7.3.310.0000.00716.23
7.3.300.0000.00616.32
7.3.290.0060.00916.39
7.3.280.0100.00816.34
7.3.270.0060.01117.40
7.3.260.0070.01016.43
7.3.250.0100.00716.43
7.3.240.0110.00616.25
7.3.230.0070.01016.65
7.3.210.0090.00816.49
7.3.200.0100.01019.39
7.3.190.0060.01016.45
7.3.180.0060.00916.48
7.3.170.0060.01016.34
7.3.160.0090.00616.43
7.3.120.0000.01314.92
7.2.330.0030.01416.62
7.2.320.0100.01216.67
7.2.310.0090.01216.81
7.2.300.0130.00716.74
7.2.290.0070.01016.35
7.2.60.0060.00917.00
7.2.00.0110.00518.67
7.1.200.0080.00315.90
7.1.100.0000.00818.10
7.1.70.0000.00716.87
7.1.60.0070.01519.24
7.1.50.0090.00916.69
7.1.00.0070.07322.32
7.0.200.0050.00516.71
7.0.140.0030.07321.93
7.0.100.0100.04020.00
7.0.90.0130.05019.89
7.0.80.0000.04320.00
7.0.70.0030.04019.98
7.0.60.0070.04319.92
7.0.50.0030.04320.39
7.0.40.0100.03020.00
7.0.30.0000.03720.15
7.0.20.0070.04320.10
7.0.10.0100.03019.99
7.0.00.0030.03720.10
5.6.250.0000.04320.57
5.6.240.0070.04020.67
5.6.230.0070.04020.63
5.6.220.0100.03720.48
5.6.210.0030.04020.75
5.6.200.0170.03321.12
5.6.190.0100.02721.02
5.6.180.0030.03320.96
5.6.170.0030.03321.02
5.6.160.0030.04021.14
5.6.150.0070.05321.04
5.6.140.0030.04321.16
5.6.130.0030.04320.94
5.6.120.0070.03321.03
5.6.110.0100.03321.13
5.6.100.0100.03720.88
5.6.90.0030.08321.03
5.6.80.0030.08020.50
5.6.70.0070.03320.55
5.6.60.0070.06320.38
5.6.50.0030.08320.47
5.6.40.0070.06720.45
5.6.30.0070.04320.40
5.6.20.0030.08320.37
5.6.10.0170.07320.36
5.6.00.0030.06320.35
5.5.380.0100.03320.41
5.5.370.0000.04320.40
5.5.360.0030.05320.42
5.5.350.0070.03020.37
5.5.340.0100.03320.93
5.5.330.0030.03320.88
5.5.320.0030.04020.93
5.5.310.0030.03320.79
5.5.300.0070.03320.64
5.5.290.0070.03720.79
5.5.280.0000.03720.86
5.5.270.0070.03720.82
5.5.260.0070.03320.86
5.5.250.0100.08020.61
5.5.240.0130.06720.25
5.5.230.0000.04320.22
5.5.220.0130.04320.23
5.5.210.0030.04320.17
5.5.200.0130.06720.24
5.5.190.0070.07720.14
5.5.180.0070.07020.18
5.5.160.0070.04720.23
5.5.150.0130.07020.27
5.5.140.0030.08020.27
5.5.130.0070.06720.25
5.5.120.0070.07720.17
5.5.110.0070.03720.24
5.5.100.0070.03319.98
5.5.90.0030.07020.09
5.5.80.0100.06020.04
5.5.70.0100.06319.94
5.5.60.0070.07720.05
5.5.50.0100.03720.10
5.5.40.0030.08020.05
5.5.30.0130.07020.08
5.5.20.0070.07319.96
5.5.10.0100.04020.05
5.5.00.0030.05019.97
5.4.450.0070.03719.49
5.4.440.0070.03019.51
5.4.430.0030.04019.53
5.4.420.0070.03019.36
5.4.410.0070.07319.27
5.4.400.0070.07018.91
5.4.390.0070.06719.05
5.4.380.0130.07018.90
5.4.370.0070.07319.20
5.4.360.0100.07019.16
5.4.350.0030.04318.84
5.4.340.0100.05719.03
5.4.320.0100.07719.09
5.4.310.0030.04018.91
5.4.300.0030.06319.02
5.4.290.0070.07019.12
5.4.280.0030.07719.03
5.4.270.0030.03319.03
5.4.260.0030.07018.87
5.4.250.0070.07318.94
5.4.240.0100.06719.04
5.4.230.0070.06719.13
5.4.220.0130.03719.04
5.4.210.0100.06719.02
5.4.200.0170.06018.94
5.4.190.0030.07719.20
5.4.180.0070.07318.86
5.4.170.0200.06018.83
5.4.160.0130.07019.19
5.4.150.0030.06318.86
5.4.140.0030.04316.46
5.4.130.0030.07316.24
5.4.120.0070.03716.18
5.4.110.0100.04716.36
5.4.100.0000.04016.36
5.4.90.0100.06016.34
5.4.80.0030.04016.47
5.4.70.0000.04016.42
5.4.60.0030.05016.31
5.4.50.0070.06716.54
5.4.40.0070.04016.35
5.4.30.0000.06316.44
5.4.20.0130.06716.40
5.4.10.0000.03716.39
5.4.00.0000.06315.86
5.3.290.0030.06714.78
5.3.280.0030.08014.65
5.3.270.0100.04014.58
5.3.260.0100.05014.66
5.3.250.0000.08714.53
5.3.240.0100.03314.53
5.3.230.0030.04314.63
5.3.220.0000.05014.63
5.3.210.0070.07314.63
5.3.200.0170.03014.65
5.3.190.0030.06014.50
5.3.180.0000.04314.53
5.3.170.0100.04714.61
5.3.160.0130.04714.63
5.3.150.0000.06314.68
5.3.140.0130.04714.50
5.3.130.0100.07714.61
5.3.120.0030.06014.63
5.3.110.0000.08314.60
5.3.100.0200.05714.09
5.3.90.0100.05314.13
5.3.80.0070.06014.13
5.3.70.0070.06314.08
5.3.60.0000.07014.07
5.3.50.0000.03713.98
5.3.40.0000.05713.95
5.3.30.0070.06013.79
5.3.20.0030.03713.69
5.3.10.0070.03313.54
5.3.00.0130.06013.64
5.2.170.0070.06311.26
5.2.160.0000.03011.03
5.2.150.0000.06011.07
5.2.140.0000.03311.20
5.2.130.0070.04011.11
5.2.120.0070.02711.16
5.2.110.0070.05711.00
5.2.100.0000.03010.98
5.2.90.0030.02711.04
5.2.80.0070.06011.16
5.2.70.0100.05711.13
5.2.60.0000.05010.96
5.2.50.0100.06011.03
5.2.40.0070.04710.86
5.2.30.0000.03311.02
5.2.20.0070.03011.10
5.2.10.0030.06310.83
5.2.00.0000.06310.71
5.1.60.0030.05710.10
5.1.50.0000.03310.05
5.1.40.0030.0609.98
5.1.30.0000.06010.43
5.1.20.0030.04710.25
5.1.10.0030.05010.06
5.1.00.0030.05710.05
5.0.50.0030.0238.39
5.0.40.0030.0338.49
5.0.30.0000.0338.27
5.0.20.0070.0408.29
5.0.10.0030.0238.27
5.0.00.0030.0308.27
4.4.90.0000.0338.27
4.4.80.0000.0378.27
4.4.70.0000.0308.27
4.4.60.0000.0278.27
4.4.50.0030.0308.27
4.4.40.0000.0538.27
4.4.30.0100.0278.27
4.4.20.0030.0338.27
4.4.10.0030.0178.27
4.4.00.0030.0478.27
4.3.110.0030.0338.27
4.3.100.0030.0338.27
4.3.90.0000.0338.27
4.3.80.0070.0238.27
4.3.70.0000.0238.27
4.3.60.0000.0178.27
4.3.50.0070.0238.27
4.3.40.0000.0378.27
4.3.30.0000.0408.27
4.3.20.0000.0378.27
4.3.10.0070.0308.27
4.3.00.0000.0378.27

preferences:
52.12 ms | 401 KiB | 5 Q