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('/bob/'); if(false == (substr_compare('http://localhost/events/10','/events/',-$testlen)===0)){ echo 'true'; } else{ echo 'false'; } $url = 'http://localhost/events/10'; //$eventid = intval(strpos($url,'/events/').); $matches = array(); preg_match ('(\d)+',$url,$matches); echo $matches;

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.0130.00618.65
8.3.30.0160.00019.06
8.3.20.0080.00020.21
8.3.10.0070.00021.97
8.3.00.0080.00022.42
8.2.170.0060.00922.96
8.2.160.0040.01220.99
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00419.36
8.2.110.0030.00622.15
8.2.100.0080.00417.91
8.2.90.0050.00318.86
8.2.80.0030.00617.97
8.2.70.0000.00817.50
8.2.60.0040.00418.05
8.2.50.0070.00418.07
8.2.40.0040.00418.09
8.2.30.0000.00917.97
8.2.20.0040.00417.66
8.2.10.0050.00319.54
8.2.00.0030.00617.70
8.1.270.0000.00922.25
8.1.260.0040.00426.35
8.1.250.0080.01128.09
8.1.240.0060.00323.79
8.1.230.0070.00419.02
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0030.00617.51
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0040.00421.92
8.1.150.0040.00418.55
8.1.140.0080.00317.46
8.1.130.0040.00417.88
8.1.120.0030.00517.54
8.1.110.0000.00817.45
8.1.100.0040.00417.49
8.1.90.0000.00817.30
8.1.80.0000.00717.42
8.1.70.0040.00417.38
8.1.60.0040.00417.61
8.1.50.0030.00517.41
8.1.40.0030.00517.52
8.1.30.0080.00017.57
8.1.20.0050.00317.70
8.1.10.0000.00817.54
8.1.00.0040.00417.47
8.0.300.0070.00018.77
8.0.290.0000.00817.18
8.0.280.0030.00318.41
8.0.270.0040.00417.21
8.0.260.0090.00016.76
8.0.250.0000.00917.03
8.0.240.0040.00417.03
8.0.230.0030.00316.91
8.0.220.0000.00816.89
8.0.210.0040.00416.93
8.0.200.0030.00316.91
8.0.190.0040.00416.91
8.0.180.0000.00716.92
8.0.170.0030.00516.98
8.0.160.0040.00416.85
8.0.150.0000.00716.92
8.0.140.0000.00816.79
8.0.130.0000.00613.38
8.0.120.0000.00816.91
8.0.110.0000.00716.93
8.0.100.0030.00516.80
8.0.90.0000.00716.77
8.0.80.0040.01116.95
8.0.70.0040.00416.79
8.0.60.0000.00716.95
8.0.50.0040.00416.73
8.0.30.0160.00317.10
8.0.20.0170.00217.40
8.0.10.0070.00016.86
8.0.00.0080.01216.86
7.4.330.0030.00315.09
7.4.320.0000.00616.50
7.4.300.0060.00016.42
7.4.290.0080.00316.51
7.4.280.0000.00816.42
7.4.270.0040.00416.65
7.4.260.0030.00316.56
7.4.250.0040.00416.36
7.4.240.0030.00516.52
7.4.230.0070.00016.70
7.4.220.0030.02016.50
7.4.210.0080.00916.56
7.4.200.0070.00016.51
7.4.190.0030.00316.54
7.4.160.0100.01316.64
7.4.150.0070.01017.40
7.4.140.0110.00817.86
7.4.130.0160.00216.55
7.4.120.0050.01216.54
7.4.110.0140.00316.55
7.4.100.0110.00516.45
7.4.90.0100.00716.36
7.4.80.0120.00619.39
7.4.70.0060.01216.55
7.4.60.0060.00916.61
7.4.50.0000.00616.36
7.4.40.0070.01122.77
7.4.30.0120.00316.52
7.4.10.0080.01114.85
7.4.00.0070.01115.05
7.3.330.0060.00013.29
7.3.320.0000.00713.21
7.3.310.0040.00416.47
7.3.300.0000.00716.46
7.3.290.0110.00416.32
7.3.280.0080.00816.44
7.3.270.0110.00517.40
7.3.260.0000.01716.61
7.3.250.0100.01016.50
7.3.240.0080.00816.52
7.3.230.0100.00616.56
7.3.210.0130.00316.47
7.3.200.0240.00219.39
7.3.190.0090.00916.57
7.3.180.0030.01616.44
7.3.170.0080.00816.53
7.3.160.0100.00616.53
7.3.130.0110.00715.06
7.3.120.0070.00814.93
7.3.110.0050.01215.11
7.3.100.0070.01014.87
7.3.90.0090.00514.91
7.3.80.0030.01014.96
7.3.70.0030.01314.78
7.3.60.0030.01314.82
7.3.50.0030.00714.90
7.3.40.0080.00814.88
7.3.30.0060.00614.96
7.3.20.0010.00816.71
7.3.10.0060.00916.67
7.3.00.0080.00616.65
7.2.330.0140.00316.79
7.2.320.0100.01416.38
7.2.310.0130.00316.32
7.2.300.0110.00816.78
7.2.290.0060.01516.36
7.2.260.0060.01215.09
7.2.250.0090.01015.18
7.2.240.0060.00715.06
7.2.230.0080.00514.93
7.2.220.0080.00814.62
7.2.210.0080.00915.01
7.2.200.0080.00614.97
7.2.190.0050.00714.94
7.2.180.0020.01115.02
7.2.170.0080.00714.99
7.2.160.0050.00714.81
7.2.150.0030.00716.96
7.2.140.0060.00616.70
7.2.130.0080.00516.65
7.2.120.0050.00816.81
7.2.110.0060.00716.83
7.2.100.0080.00616.81
7.2.90.0080.00616.74
7.2.80.0060.00816.74
7.2.70.0060.00616.88
7.2.60.0090.00616.73
7.2.50.0050.00816.78
7.2.40.0060.00716.69
7.2.30.0060.00916.69
7.2.20.0060.00816.76
7.2.10.0070.00716.71
7.2.00.0080.00617.16
7.1.330.0070.00515.81
7.1.320.0030.00915.78
7.1.310.0110.00515.81
7.1.300.0020.01115.65
7.1.290.0040.00915.70
7.1.280.0060.00815.83
7.1.270.0020.01215.98
7.1.260.0110.00415.63
7.1.250.0080.00715.71
7.1.240.0040.00715.78
7.1.230.0050.00815.90
7.1.220.0030.01015.86
7.1.210.0040.00915.87
7.1.200.0100.00515.79
7.1.190.0050.00715.67
7.1.180.0070.00715.73
7.1.170.0060.00615.86
7.1.160.0080.00715.82
7.1.150.0040.00615.82
7.1.140.0050.00815.83
7.1.130.0050.00815.80
7.1.120.0000.01115.64
7.1.110.0060.00615.88
7.1.100.0050.00916.66
7.1.90.0060.00815.74
7.1.80.0050.00615.81
7.1.70.0040.00816.11
7.1.60.0080.00517.19
7.1.50.0070.00716.31
7.1.40.0040.00715.93
7.1.30.0050.00815.75
7.1.20.0050.01115.74
7.1.10.0080.00315.72
7.1.00.0050.03218.04
7.0.330.0030.00815.48
7.0.320.0020.00915.28
7.0.310.0050.00715.51
7.0.300.0030.01015.48
7.0.290.0060.00915.40
7.0.280.0000.01315.48
7.0.270.0060.00715.18
7.0.260.0020.00815.28
7.0.250.0050.00815.32
7.0.240.0070.00715.35
7.0.230.0100.00215.19
7.0.220.0030.01015.57
7.0.210.0050.00615.49
7.0.200.0070.00615.92
7.0.190.0070.00815.47
7.0.180.0020.01115.46
7.0.170.0060.00915.37
7.0.160.0110.00415.29
7.0.150.0030.01015.43
7.0.140.0030.02817.63
7.0.130.0070.00515.51
7.0.120.0060.00315.65
7.0.110.0050.00515.54
7.0.100.0060.03316.89
7.0.90.0050.02717.00
7.0.80.0060.02916.89
7.0.70.0080.03016.87
7.0.60.0080.01917.03
7.0.50.0060.02017.13
7.0.40.0050.01815.77
7.0.30.0050.03015.70
7.0.20.0060.02515.64
7.0.10.0050.02815.75
7.0.00.0080.01615.55
5.6.400.0050.01114.31
5.6.390.0030.00714.55
5.6.380.0050.00914.11
5.6.370.0030.01014.32
5.6.360.0080.00414.45
5.6.350.0080.00614.56
5.6.340.0060.00914.30
5.6.330.0080.00514.58
5.6.320.0070.00714.50
5.6.310.0070.00714.23
5.6.300.0060.00614.37
5.6.290.0070.00614.23
5.6.280.0040.03116.63
5.6.270.0090.00714.27
5.6.260.0050.00814.17
5.6.250.0080.02916.51
5.6.240.0060.01916.37
5.6.230.0080.03016.36
5.6.220.0110.02716.39
5.6.210.0070.02116.46
5.6.200.0090.03116.64
5.6.190.0080.03116.65
5.6.180.0150.02316.52
5.6.170.0040.02016.53
5.6.160.0050.01916.55
5.6.150.0020.02516.54
5.6.140.0100.01516.61
5.6.130.0050.01916.57
5.6.120.0040.02216.49
5.6.110.0050.02016.57
5.6.100.0060.03016.46
5.6.90.0040.02616.46
5.6.80.0010.02116.30
5.6.70.0050.01716.47
5.6.60.0010.02116.26
5.6.50.0080.01516.11
5.6.40.0020.01916.32
5.6.30.0060.01916.23
5.6.20.0040.01716.30
5.6.10.0070.01316.35
5.6.00.0030.02116.26
5.5.380.0080.03016.32
5.5.370.0070.02016.28
5.5.360.0080.03616.32
5.5.350.0080.02416.42
5.5.340.0070.03116.49
5.5.330.0090.02616.22
5.5.320.0000.03316.41
5.5.310.0070.01716.31
5.5.300.0060.01916.50
5.5.290.0040.02216.44
5.5.280.0080.01516.55
5.5.270.0040.03316.46
5.5.260.0060.02116.47
5.5.250.0070.02516.40
5.5.240.0090.01316.15
5.5.230.0060.01716.18
5.5.220.0020.01916.19
5.5.210.0070.01716.20
5.5.200.0070.02016.18
5.5.190.0030.01916.16
5.5.180.0050.01916.22
5.5.170.0080.00714.26
5.5.160.0030.01916.21
5.5.150.0080.01316.26
5.5.140.0030.02016.32
5.5.130.0040.01716.17
5.5.120.0070.01716.22
5.5.110.0030.01616.10
5.5.100.0080.01716.11
5.5.90.0020.01916.21
5.5.80.0070.01616.23
5.5.70.0050.02016.24
5.5.60.0020.02116.17
5.5.50.0070.01416.17
5.5.40.0090.01716.02
5.5.30.0020.03016.18
5.5.20.0070.02316.06
5.5.10.0080.02916.00
5.5.00.0030.02716.24
5.4.450.0060.01614.50
5.4.440.0030.02814.56
5.4.430.0050.01814.46
5.4.420.0050.01414.35
5.4.410.0040.01514.44
5.4.400.0060.01714.38
5.4.390.0070.01514.36
5.4.380.0030.01614.29
5.4.370.0020.01814.42
5.4.360.0030.01814.30
5.4.350.0050.01414.40
5.4.340.0030.01714.36
5.4.330.0070.00312.08
5.4.320.0020.01714.38
5.4.310.0040.01714.41
5.4.300.0040.01314.25
5.4.290.0020.01614.34
5.4.280.0020.01414.36
5.4.270.0040.01314.37
5.4.260.0030.01614.23
5.4.250.0040.01514.31
5.4.240.0020.01814.31
5.4.230.0080.01014.33
5.4.220.0050.01614.42
5.4.210.0080.02814.48
5.4.200.0060.02714.43
5.4.190.0030.02114.32
5.4.180.0040.02714.28
5.4.170.0050.02014.41
5.4.160.0050.02414.33
5.4.150.0030.02414.22
5.4.140.0020.02413.53
5.4.130.0000.02113.48
5.4.120.0030.02213.43
5.4.110.0100.01413.54
5.4.100.0050.02713.54
5.4.90.0040.02713.41
5.4.80.0020.01713.43
5.4.70.0010.02113.46
5.4.60.0020.01713.48
5.4.50.0070.02813.46
5.4.40.0040.02813.53
5.4.30.0040.02813.54
5.4.20.0100.02413.52
5.4.10.0070.02713.53
5.4.00.0050.01613.21
5.3.290.0050.01312.77
5.3.280.0000.01912.80
5.3.270.0030.02912.76
5.3.260.0030.02212.76
5.3.250.0030.03012.82
5.3.240.0070.02112.81
5.3.230.0060.02512.77
5.3.220.0050.02212.75
5.3.210.0110.02312.76
5.3.200.0060.02512.75
5.3.190.0070.01812.79
5.3.180.0070.01712.78
5.3.170.0040.03012.75
5.3.160.0070.02712.77
5.3.150.0070.02212.81
5.3.140.0060.01812.77
5.3.130.0030.02712.77
5.3.120.0010.03312.75
5.3.110.0060.02612.77
5.3.100.0050.02012.57
5.3.90.0020.01912.56
5.3.80.0080.02512.59
5.3.70.0060.01912.55
5.3.60.0050.02512.53
5.3.50.0080.01912.51
5.3.40.0090.02712.55
5.3.30.0030.02912.54
5.3.20.0030.01912.49
5.3.10.0080.02412.45
5.3.00.0040.02112.45
5.2.170.0070.04312.29
5.2.160.0030.06012.29
5.2.150.0100.05312.29
5.2.140.0070.06012.29
5.2.130.0100.02712.29
5.2.120.0030.06312.29
5.2.110.0000.04712.29
5.2.100.0070.06312.29
5.2.90.0070.05712.29
5.2.80.0070.06012.29
5.2.70.0070.06012.29
5.2.60.0070.06312.29
5.2.50.0030.04012.29
5.2.40.0030.07012.29
5.2.30.0100.05312.29
5.2.20.0000.06712.29
5.2.10.0000.04012.29
5.2.00.0100.06312.29
5.1.60.0030.03312.29
5.1.50.0070.05712.29
5.1.40.0070.03312.29
5.1.30.0200.01712.29
5.1.20.0000.05012.29
5.1.10.0030.05312.29
5.1.00.0030.04712.29
5.0.50.0030.04312.29
5.0.40.0030.04712.29
5.0.30.0070.06012.29
5.0.20.0000.03312.29
5.0.10.0070.03712.29
5.0.00.0030.04312.29
4.4.90.0030.02712.29
4.4.80.0070.02712.29
4.4.70.0070.03312.29
4.4.60.0100.02712.29
4.4.50.0100.03012.29
4.4.40.0070.05312.29
4.4.30.0070.01712.29
4.4.20.0000.03312.29
4.4.10.0030.03312.29
4.4.00.0000.05012.29
4.3.110.0100.02712.29
4.3.100.0070.03012.29
4.3.90.0030.02312.29
4.3.80.0000.03712.29
4.3.70.0000.03712.29
4.3.60.0000.02712.29
4.3.50.0000.01712.29
4.3.40.0030.04312.29
4.3.30.0000.03712.29
4.3.20.0000.03712.29
4.3.10.0000.03312.29
4.3.00.0000.03012.29

preferences:
41.71 ms | 400 KiB | 5 Q