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\n"; } else{ echo "false\n"; } $testlen = strlen('/bob/'); if(false == (substr_compare('http://localhost/events/10','/events/',-$testlen)===0)){ echo "true\n"; } else{ echo "false\n"; } $url = 'http://192.168.1.0/events/10'; //$eventid = intval(strpos($url,'/events/').); preg_match_all ('/^(\d)+/',$url,$matches); $arraylen = count($matches); for($x=0;$x<$arraylen;$x++){ echo $matches[$x][0]."\n"; }

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.0120.00619.13
8.3.30.0120.00318.93
8.3.20.0050.00319.08
8.3.10.0080.00820.64
8.3.00.0050.00319.63
8.2.170.0120.00322.96
8.2.160.0140.00321.08
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0070.00020.99
8.2.110.0090.00320.31
8.2.100.0070.00417.97
8.2.90.0090.00019.36
8.2.80.0030.00518.00
8.2.70.0060.00317.88
8.2.60.0040.00418.05
8.2.50.0090.00018.07
8.2.40.0030.00518.09
8.2.30.0070.00018.16
8.2.20.0000.00917.99
8.2.10.0030.00517.91
8.2.00.0080.00318.05
8.1.270.0000.00823.99
8.1.260.0060.00326.35
8.1.250.0060.00928.09
8.1.240.0030.00622.13
8.1.230.0080.00417.58
8.1.220.0030.00617.76
8.1.210.0060.00318.77
8.1.200.0030.00617.47
8.1.190.0040.00417.63
8.1.180.0090.00018.10
8.1.170.0000.00818.65
8.1.160.0040.00418.98
8.1.150.0040.00418.82
8.1.140.0040.00417.69
8.1.130.0070.00017.92
8.1.120.0000.00817.63
8.1.110.0000.00717.59
8.1.100.0000.00817.60
8.1.90.0000.00717.54
8.1.80.0000.00817.66
8.1.70.0040.00417.57
8.1.60.0000.00817.66
8.1.50.0060.00317.61
8.1.40.0000.00717.63
8.1.30.0030.00517.80
8.1.20.0070.00017.82
8.1.10.0040.00417.63
8.1.00.0030.00517.58
8.0.300.0020.00518.77
8.0.290.0040.00417.00
8.0.280.0040.00418.46
8.0.270.0030.00317.22
8.0.260.0030.00317.12
8.0.250.0040.00417.22
8.0.240.0000.00717.20
8.0.230.0030.00317.10
8.0.220.0000.00817.20
8.0.210.0040.00717.09
8.0.200.0080.00317.08
8.0.190.0040.00417.18
8.0.180.0000.00717.19
8.0.170.0090.00016.98
8.0.160.0070.00017.22
8.0.150.0040.00417.00
8.0.140.0080.00317.09
8.0.130.0030.00313.60
8.0.120.0040.00417.15
8.0.110.0000.00717.04
8.0.100.0050.00217.12
8.0.90.0070.00017.14
8.0.80.0060.01617.07
8.0.70.0070.00016.93
8.0.60.0000.00817.19
8.0.50.0040.00416.96
8.0.30.0090.00617.02
8.0.20.0100.01017.31
8.0.10.0040.00417.20
8.0.00.0130.00817.06
7.4.330.0030.00313.29
7.4.320.0000.00616.67
7.4.300.0030.00316.74
7.4.290.0000.00716.71
7.4.280.0040.00416.83
7.4.270.0000.00716.89
7.4.260.0030.00313.48
7.4.250.0000.00716.63
7.4.240.0040.00416.80
7.4.230.0070.00016.87
7.4.220.0060.01216.85
7.4.210.0060.00916.79
7.4.200.0000.00716.66
7.4.190.0000.00716.71
7.4.160.0160.00716.81
7.4.150.0110.00816.89
7.4.140.0100.00716.98
7.4.130.0110.00516.98
7.4.120.0140.00316.51
7.4.110.0140.00316.72
7.4.100.0070.01016.55
7.4.90.0180.00017.08
7.4.80.0150.00619.39
7.4.70.0140.01016.70
7.4.60.0070.01016.67
7.4.50.0060.00316.84
7.4.40.0060.01216.75
7.4.30.0120.00416.80
7.4.00.0070.00715.09
7.3.330.0030.00313.44
7.3.320.0030.00313.45
7.3.310.0040.00416.59
7.3.300.0030.00316.57
7.3.290.0110.00516.60
7.3.280.0100.00716.67
7.3.270.0050.01516.95
7.3.260.0090.00916.73
7.3.250.0160.00116.68
7.3.240.0110.00616.64
7.3.230.0110.00716.88
7.3.210.0140.00316.64
7.3.200.0040.01316.80
7.3.190.0090.00616.86
7.3.180.0090.00616.73
7.3.170.0150.00616.89
7.3.160.0050.01116.71
7.3.120.0090.00615.19
7.2.330.0040.01416.70
7.2.320.0070.01116.86
7.2.310.0070.01016.99
7.2.300.0070.01316.98
7.2.290.0060.01416.95
7.2.00.0230.01219.07
7.1.200.0040.00815.96
7.1.100.0070.00718.28
7.1.70.0030.00617.54
7.1.60.0110.01419.30
7.1.50.0060.01217.15
7.1.00.0000.03722.48
7.0.200.0030.00716.68
7.0.140.0000.07722.18
7.0.120.0100.05722.05
7.0.60.0030.04019.84
7.0.50.0030.04317.90
7.0.40.0070.07720.32
7.0.30.0370.07020.12
7.0.20.0330.07720.27
7.0.10.0170.08020.34
7.0.00.0030.05020.20
5.6.280.0100.06721.02
5.6.210.0030.08720.73
5.6.200.0030.04718.14
5.6.190.0100.06320.41
5.6.180.0330.03720.77
5.6.170.0330.06020.50
5.6.160.0170.07320.42
5.6.150.0070.06718.14
5.6.140.0000.04018.15
5.6.130.0000.08018.23
5.6.120.0070.08321.00
5.6.110.0100.08021.08
5.6.100.0030.04320.99
5.6.90.0100.06721.14
5.6.80.0070.07320.54
5.5.350.0200.04020.45
5.5.340.0070.03718.05
5.5.330.0030.08020.21
5.5.320.0200.05320.42
5.5.310.0170.04020.19
5.5.300.0130.05717.96
5.5.290.0000.07317.96
5.5.280.0170.05320.80
5.5.270.0170.07320.89
5.5.260.0030.07720.79
5.5.250.0100.03320.50
5.5.240.0070.07720.18
5.4.450.0070.08019.47
5.4.440.0130.07319.17
5.4.430.0070.07719.56
5.4.420.0070.04319.56
5.4.410.0070.03719.27
5.4.400.0070.04018.98
5.4.390.0070.06719.25
5.4.380.0030.04319.24
5.4.370.0030.06719.24
5.4.360.0130.05019.15
5.4.350.0130.05719.22
5.4.340.0130.05019.00
5.4.320.0070.04718.86
5.4.310.0070.07719.12
5.4.300.0100.04318.86
5.4.290.0030.06018.96
5.4.280.0030.07719.20
5.4.270.0100.07019.13
5.4.260.0070.08018.86
5.4.250.0130.07019.20
5.4.240.0030.06319.24
5.4.230.0070.07718.91
5.4.220.0030.05718.91
5.4.210.0130.06719.14
5.4.200.0000.05018.87
5.4.190.0100.07019.07
5.4.180.0130.07319.23
5.4.170.0170.04019.07
5.4.160.0070.07719.21
5.4.150.0100.06719.10
5.4.140.0070.05716.32
5.4.130.0030.07016.36
5.4.120.0130.05016.38
5.4.110.0100.08716.35
5.4.100.0070.05716.44
5.4.90.0030.04316.35
5.4.80.0100.04716.39
5.4.70.0000.06016.43
5.4.60.0000.04016.66
5.4.50.0130.05716.38
5.4.40.0070.07016.31
5.4.30.0170.06316.36
5.4.20.0030.07716.27
5.4.10.0070.07316.41
5.4.00.0000.06715.82
5.3.290.0100.07314.73
5.3.280.0100.06314.48
5.3.270.0130.07014.64
5.3.260.0070.07314.66
5.3.250.0130.06714.63
5.3.240.0100.05314.50
5.3.230.0030.08014.67
5.3.220.0030.06014.62
5.3.210.0070.07014.71
5.3.200.0070.08014.62
5.3.190.0030.05014.61
5.3.180.0100.07014.61
5.3.170.0100.03714.61
5.3.160.0100.07314.45
5.3.150.0030.08314.57
5.3.140.0070.07314.55
5.3.130.0100.07714.55
5.3.120.0100.06014.63
5.3.110.0130.04314.46
5.3.100.0100.07714.08
5.3.90.0030.04714.07
5.3.80.0070.07314.16
5.3.70.0100.07014.07
5.3.60.0070.04314.00
5.3.50.0200.05313.91
5.3.40.0070.07713.91
5.3.30.0030.04313.96
5.3.20.0030.03713.85
5.3.10.0100.06313.65
5.3.00.0000.07713.68
5.2.170.0100.03311.15
5.2.160.0000.03311.04
5.2.150.0000.06011.15
5.2.140.0030.05311.20
5.2.130.0100.05311.07
5.2.120.0070.06011.11
5.2.110.0030.06311.09
5.2.100.0100.05711.26
5.2.90.0030.06711.16
5.2.80.0030.06011.15
5.2.70.0030.06011.17
5.2.60.0070.04011.04
5.2.50.0030.03311.18
5.2.40.0170.03311.02
5.2.30.0030.03010.98
5.2.20.0030.04011.02
5.2.10.0030.06010.82
5.2.00.0000.03310.77
5.1.60.0070.0339.99
5.1.50.0070.0239.99
5.1.40.0070.04310.05
5.1.30.0030.06010.35
5.1.20.0030.05310.31
5.1.10.0030.06010.11
5.1.00.0070.04710.13
5.0.50.0100.0408.46
5.0.40.0000.0408.47
5.0.30.0000.0638.13
5.0.20.0030.0278.35
5.0.10.0070.0308.14
5.0.00.0030.0508.07
4.4.90.0000.0407.94
4.4.80.0070.0337.94
4.4.70.0030.0237.94
4.4.60.0000.0207.94
4.4.50.0000.0407.94
4.4.40.0030.0237.94
4.4.30.0070.0307.94
4.4.20.0100.0307.94
4.4.10.0070.0207.94
4.4.00.0000.0507.94
4.3.110.0070.0337.94
4.3.100.0000.0237.94
4.3.90.0030.0377.94
4.3.80.0030.0307.94
4.3.70.0000.0177.94
4.3.60.0070.0307.94
4.3.50.0070.0337.94
4.3.40.0030.0437.94
4.3.30.0000.0377.94
4.3.20.0000.0377.94
4.3.10.0000.0277.94
4.3.00.0000.0407.94

preferences:
41.61 ms | 400 KiB | 5 Q