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.70.0110.00818.37
8.3.60.0090.00616.63
8.3.50.0100.00817.57
8.3.40.0070.00718.97
8.3.30.0090.00619.04
8.3.20.0080.00018.89
8.3.10.0080.00020.61
8.3.00.0080.00819.51
8.2.180.0150.00316.75
8.2.170.0170.00322.96
8.2.160.0070.01021.37
8.2.150.0150.00424.18
8.2.140.0000.00724.66
8.2.130.0060.00326.16
8.2.120.0000.00819.61
8.2.110.0070.00319.30
8.2.100.0030.00917.75
8.2.90.0000.00819.30
8.2.80.0040.00417.97
8.2.70.0030.00617.84
8.2.60.0000.00818.05
8.2.50.0030.00718.09
8.2.40.0080.00018.22
8.2.30.0050.00318.30
8.2.20.0000.00817.84
8.2.10.0000.00717.99
8.2.00.0040.00417.80
8.1.280.0150.00025.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0040.00422.70
8.1.230.0040.00817.73
8.1.220.0000.00817.77
8.1.210.0050.00318.77
8.1.200.0060.00317.47
8.1.190.0000.00817.60
8.1.180.0040.00418.10
8.1.170.0000.00818.71
8.1.160.0000.00718.98
8.1.150.0040.00418.82
8.1.140.0000.00717.67
8.1.130.0000.00717.88
8.1.120.0050.00317.61
8.1.110.0060.00317.57
8.1.100.0050.00217.71
8.1.90.0000.00817.68
8.1.80.0040.00417.56
8.1.70.0000.00717.65
8.1.60.0030.00617.80
8.1.50.0080.00017.70
8.1.40.0040.00417.72
8.1.30.0000.00817.79
8.1.20.0080.00017.75
8.1.10.0030.00617.76
8.1.00.0030.00617.58
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0000.00718.43
8.0.270.0000.00717.31
8.0.260.0030.00316.92
8.0.250.0000.00717.13
8.0.240.0040.00417.04
8.0.230.0070.00017.05
8.0.220.0060.00317.04
8.0.210.0030.00317.05
8.0.200.0000.00717.04
8.0.190.0040.00417.18
8.0.180.0000.00816.98
8.0.170.0060.00317.09
8.0.160.0070.00016.96
8.0.150.0030.00617.02
8.0.140.0060.00317.02
8.0.130.0000.00613.44
8.0.120.0070.00017.07
8.0.110.0040.00417.04
8.0.100.0000.00717.11
8.0.90.0040.00417.11
8.0.80.0030.01217.11
8.0.70.0050.00316.94
8.0.60.0000.00817.10
8.0.50.0050.00316.97
8.0.30.0130.00717.20
8.0.20.0070.01217.34
8.0.10.0040.00417.25
8.0.00.0110.00917.01
7.4.330.0000.00513.25
7.4.320.0060.00016.76
7.4.300.0060.00016.76
7.4.290.0070.00016.73
7.4.280.0040.00416.89
7.4.270.0030.00316.76
7.4.260.0000.00513.54
7.4.250.0030.00516.70
7.4.240.0070.00016.89
7.4.230.0000.00716.84
7.4.220.0120.00616.73
7.4.210.0050.01016.84
7.4.200.0000.00716.85
7.4.190.0000.00716.65
7.4.160.0100.00716.70
7.4.150.0070.01116.70
7.4.140.0090.01116.74
7.4.130.0050.01416.61
7.4.120.0070.01016.71
7.4.110.0030.01616.81
7.4.100.0070.01116.77
7.4.90.0060.01216.68
7.4.80.0180.00619.39
7.4.70.0150.00716.75
7.4.60.0110.00916.61
7.4.50.0030.00616.92
7.4.40.0030.00916.73
7.4.30.0120.00416.75
7.4.00.0030.01014.97
7.3.330.0000.00713.41
7.3.320.0000.00613.43
7.3.310.0000.00716.69
7.3.300.0070.00016.50
7.3.290.0150.00616.55
7.3.280.0030.01216.59
7.3.270.0100.01416.75
7.3.260.0100.01016.89
7.3.250.0070.01116.61
7.3.240.0120.00616.57
7.3.230.0090.00916.64
7.3.210.0070.01016.53
7.3.200.0100.00716.88
7.3.190.0110.00616.68
7.3.180.0060.01216.70
7.3.170.0130.00616.67
7.3.160.0100.00616.69
7.3.120.0100.00315.30
7.2.330.0000.01816.88
7.2.320.0210.00416.98
7.2.310.0120.00917.02
7.2.300.0060.01216.87
7.2.290.0060.01016.79
7.2.00.0000.01019.77
7.1.100.0090.00316.30
7.1.70.0000.00817.37
7.1.60.0070.01719.40
7.1.50.0060.01617.16
7.1.00.0070.07322.32
7.0.200.0090.00615.05
7.0.140.0070.07322.21
7.0.120.0000.07722.25
7.0.60.0070.06320.04
7.0.50.0130.03317.88
7.0.40.0030.04320.13
7.0.30.0230.05020.11
7.0.20.0270.08020.20
7.0.10.0000.09320.35
7.0.00.0070.04020.16
5.6.280.0030.07321.14
5.6.210.0030.08720.70
5.6.200.0000.06318.20
5.6.190.0170.06320.43
5.6.180.0300.05020.61
5.6.170.0300.04320.59
5.6.160.0170.05720.57
5.6.150.0170.06318.25
5.6.140.0100.06318.18
5.6.130.0030.08318.23
5.6.120.0070.08321.00
5.6.110.0070.08720.92
5.6.100.0100.08320.96
5.6.90.0230.06720.98
5.6.80.0030.04020.45
5.6.70.4200.04020.50
5.5.350.0170.08720.50
5.5.340.0100.06718.09
5.5.330.0030.06720.29
5.5.320.0200.04020.37
5.5.310.0270.04320.28
5.5.300.0130.03717.95
5.5.290.0070.08717.98
5.5.280.0070.06020.77
5.5.270.0030.08320.87
5.5.260.0070.08720.73
5.5.250.0070.08720.58
5.5.240.0230.03720.07
5.4.450.0030.04719.20
5.4.440.0030.04019.32
5.4.430.0070.04319.56
5.4.420.0000.05019.47
5.4.410.0070.04019.37
5.4.400.0000.04019.21
5.4.390.0100.03719.25
5.4.380.0000.04319.24
5.4.370.0030.03719.00
5.4.360.0100.04019.14
5.4.350.0170.03019.15
5.4.340.0100.06719.24
5.4.320.0070.04319.25
5.4.310.0100.07319.07
5.4.300.0070.04319.00
5.4.290.0130.06719.23
5.4.280.0100.06719.15
5.4.270.0030.06318.98
5.4.260.0070.06018.87
5.4.250.0100.04018.85
5.4.240.0030.04718.91
5.4.230.0030.06719.15
5.4.220.0070.04318.98
5.4.210.0070.04718.91
5.4.200.0100.03719.23
5.4.190.0070.04319.13
5.4.180.0130.06319.11
5.4.170.0100.07018.91
5.4.160.0030.04718.86
5.4.150.0030.04719.23
5.4.140.0100.06316.62
5.4.130.0070.06016.49
5.4.120.0000.07016.51
5.4.110.0070.03316.35
5.4.100.0130.06716.32
5.4.90.0070.06316.50
5.4.80.0030.06316.34
5.4.70.0000.04016.46
5.4.60.0130.04316.46
5.4.50.0000.04716.39
5.4.40.0070.04016.42
5.4.30.0000.04316.25
5.4.20.0130.06316.46
5.4.10.0030.06316.37
5.4.00.0070.04315.88
5.3.290.0030.05014.69
5.3.280.0070.06014.74
5.3.270.0000.05314.63
5.3.260.0170.06314.65
5.3.250.0070.05314.64
5.3.240.0100.07314.65
5.3.230.0000.05714.61
5.3.220.0000.08014.56
5.3.210.0070.03714.73
5.3.200.0100.07014.64
5.3.190.0030.06014.62
5.3.180.0030.07714.59
5.3.170.0030.07314.72
5.3.160.0100.04014.57
5.3.150.0000.05314.45
5.3.140.0070.06014.60
5.3.130.0070.07714.55
5.3.120.0030.05714.55
5.3.110.0070.06314.70
5.3.100.0070.04314.11
5.3.90.0100.07313.91
5.3.80.0130.06714.07
5.3.70.0100.07314.02
5.3.60.0100.07314.00
5.3.50.0170.06713.91
5.3.40.0070.07714.11
5.3.30.0070.08013.83
5.3.20.0070.03313.75
5.3.10.0030.04013.82
5.3.00.0130.07013.78
5.2.170.0030.06311.07
5.2.160.0200.04711.31
5.2.150.0130.04311.11
5.2.140.0070.03311.29
5.2.130.0030.06711.16
5.2.120.0130.03711.10
5.2.110.0030.05711.24
5.2.100.0070.06011.07
5.2.90.0030.06011.02
5.2.80.0100.05711.14
5.2.70.0030.04311.07
5.2.60.0000.04011.20
5.2.50.0030.02711.07
5.2.40.0070.02711.01
5.2.30.0170.03010.98
5.2.20.0070.02710.98
5.2.10.0030.03311.00
5.2.00.0030.05710.61
5.1.60.0030.03010.06
5.1.50.0100.0209.96
5.1.40.0030.0579.89
5.1.30.0030.05710.39
5.1.20.0030.04010.51
5.1.10.0000.05010.14
5.1.00.0030.05710.04
5.0.50.0000.0438.70
5.0.40.0070.0438.45
5.0.30.0070.0538.27
5.0.20.0000.0478.23
5.0.10.0030.0478.33
5.0.00.0030.0678.16
4.4.90.0030.0337.78
4.4.80.0000.0177.80
4.4.70.0030.0177.80
4.4.60.0030.0177.80
4.4.50.0000.0377.80
4.4.40.0030.0337.80
4.4.30.0070.0207.80
4.4.20.0030.0337.80
4.4.10.0030.0337.80
4.4.00.0030.0507.80
4.3.110.0130.0277.80
4.3.100.0030.0307.80
4.3.90.0030.0237.80
4.3.80.0030.0537.80
4.3.70.0000.0337.80
4.3.60.0000.0377.80
4.3.50.0030.0177.80
4.3.40.0030.0537.80
4.3.30.0000.0377.80
4.3.20.0000.0277.80
4.3.10.0030.0337.80
4.3.00.0100.0277.80

preferences:
45.62 ms | 401 KiB | 5 Q