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); foreach( $matches as $match){ echo $match; }

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.60.0140.00316.75
8.3.50.0190.00816.40
8.3.40.0070.00718.84
8.3.30.0070.00718.71
8.3.20.0080.00018.60
8.3.10.0040.00418.80
8.3.00.0040.00419.26
8.2.180.0060.00916.74
8.2.170.0000.01422.96
8.2.160.0110.00318.87
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0000.00826.16
8.2.120.0080.00019.66
8.2.110.0030.00619.38
8.2.100.0080.00417.84
8.2.90.0060.00317.63
8.2.80.0000.00818.73
8.2.70.0060.00317.50
8.2.60.0060.00317.63
8.2.50.0040.00418.05
8.2.40.0080.00019.35
8.2.30.0110.00017.58
8.2.20.0060.00317.56
8.2.10.0080.00017.75
8.2.00.0050.00517.47
8.1.280.0110.00325.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0060.00320.70
8.1.230.0110.00022.75
8.1.220.0000.00918.65
8.1.210.0080.00018.77
8.1.200.0040.00417.38
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0040.00418.93
8.1.150.0040.00418.57
8.1.140.0040.00417.38
8.1.130.0040.00419.28
8.1.120.0000.00817.42
8.1.110.0040.00417.47
8.1.100.0000.00717.39
8.1.90.0040.00417.43
8.1.80.0070.00017.51
8.1.70.0070.00017.36
8.1.60.0040.00417.60
8.1.50.0000.00817.61
8.1.40.0000.00817.53
8.1.30.0070.00417.65
8.1.20.0060.00617.58
8.1.10.0050.00217.52
8.1.00.0000.00917.40
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.59
8.0.270.0000.00817.31
8.0.260.0000.01016.77
8.0.250.0040.00416.97
8.0.240.0000.00717.06
8.0.230.0030.00517.05
8.0.220.0000.00816.87
8.0.210.0000.00716.92
8.0.200.0060.00017.03
8.0.190.0040.00417.04
8.0.180.0000.00716.88
8.0.170.0060.00316.90
8.0.160.0040.00416.95
8.0.150.0030.00616.91
8.0.140.0000.00816.95
8.0.130.0060.00013.36
8.0.120.0030.00616.88
8.0.110.0000.00816.84
8.0.100.0080.00016.91
8.0.90.0090.00016.98
8.0.80.0060.00916.94
8.0.70.0040.00416.97
8.0.60.0030.00617.03
8.0.50.0000.00817.03
8.0.30.0150.00017.16
8.0.20.0270.01217.17
8.0.10.0040.00417.09
8.0.00.0090.00916.75
7.4.330.0050.00013.02
7.4.320.0060.00016.63
7.4.300.0030.00316.55
7.4.290.0000.00716.44
7.4.280.0040.00416.57
7.4.270.0100.00016.60
7.4.260.0030.00413.21
7.4.250.0040.00416.56
7.4.240.0000.00716.61
7.4.230.0070.00016.50
7.4.220.0060.01316.70
7.4.210.0060.01016.59
7.4.200.0000.00716.70
7.4.190.0040.00416.48
7.4.160.0080.00816.43
7.4.150.0120.00616.51
7.4.140.0130.00717.86
7.4.130.0110.00716.51
7.4.120.0150.00316.72
7.4.110.0130.01016.53
7.4.100.0070.01316.42
7.4.90.0160.00316.49
7.4.80.0090.00919.39
7.4.70.0030.01316.56
7.4.60.0110.00516.52
7.4.50.0030.00316.36
7.4.40.0040.00716.39
7.4.30.0170.00016.61
7.4.00.0030.01414.85
7.3.330.0000.00713.28
7.3.320.0030.00313.25
7.3.310.0030.00316.49
7.3.300.0000.00616.39
7.3.290.0090.00616.45
7.3.280.0060.00916.40
7.3.270.0070.01016.38
7.3.260.0130.00316.70
7.3.240.0130.00316.57
7.3.230.0060.01116.49
7.3.210.0130.00316.51
7.3.200.0080.00816.68
7.3.190.0180.00416.42
7.3.180.0160.00016.67
7.3.170.0120.00616.52
7.3.160.0030.01316.52
7.3.120.0070.01015.13
7.2.330.0150.00316.71
7.2.320.0150.00616.42
7.2.310.0030.02016.50
7.2.300.0150.00316.51
7.2.290.0150.00416.85
7.2.110.0110.00816.66
7.2.100.2260.00316.52
7.2.90.0130.00316.64
7.2.80.0150.00316.50
7.2.70.0170.00016.74
7.2.60.0100.00316.98
7.2.50.0400.00716.80
7.2.40.0140.00716.96
7.2.30.0150.00716.75
7.2.20.0150.00516.93
7.2.10.0260.00916.73
7.2.00.0110.00718.12
7.1.230.0110.00515.49
7.1.220.0090.00515.85
7.1.210.0110.00315.86
7.1.200.0070.00715.67
7.1.190.2580.00315.95
7.1.180.0230.01015.68
7.1.170.0040.01215.89
7.1.160.0100.00715.73
7.1.150.0110.00715.83
7.1.140.0130.00515.93
7.1.130.0070.00715.54
7.1.120.0230.00615.83
7.1.110.0160.00316.08
7.1.100.0060.00816.85
7.1.90.0120.00815.96
7.1.80.0160.00315.66
7.1.70.0050.00616.36
7.1.60.0180.00517.56
7.1.50.0080.01516.54
7.1.40.0120.01215.95
7.1.30.0100.00715.71
7.1.20.0080.01115.88
7.1.10.0070.00715.74
7.1.00.0060.03619.26
7.0.310.0070.00715.56
7.0.300.0420.00615.15
7.0.290.0260.00615.45
7.0.280.0200.00315.49
7.0.270.0090.00615.42
7.0.260.0070.00715.23
7.0.250.0070.01115.39
7.0.240.0070.00715.44
7.0.230.0070.01015.45
7.0.220.0100.00615.35
7.0.210.0130.00015.20
7.0.200.0150.00515.28
7.0.190.0090.00415.20
7.0.180.0130.00315.45
7.0.170.0060.01115.57
7.0.160.0120.00615.52
7.0.150.0120.00215.14
7.0.140.0050.04018.67
7.0.130.0120.00415.48
7.0.120.0060.03818.71
7.0.110.0030.01415.61
7.0.100.0090.00915.63
7.0.90.0100.00615.42
7.0.80.0150.00515.28
7.0.70.0280.00415.64
7.0.60.0090.03517.65
7.0.50.0110.04216.69
7.0.40.0070.02916.73
7.0.30.0160.03116.86
7.0.20.0260.03616.91
7.0.10.0080.04716.65
7.0.00.0070.04616.66
5.6.380.0000.01514.23
5.6.370.0080.00814.32
5.6.360.0170.00314.14
5.6.350.0120.00613.92
5.6.340.0120.00414.46
5.6.330.0100.00514.36
5.6.320.0130.00014.28
5.6.310.0100.00714.38
5.6.300.0100.00714.58
5.6.290.0040.00914.36
5.6.280.0120.03617.90
5.6.270.0060.01314.47
5.6.260.0140.00314.42
5.6.250.0130.00014.63
5.6.240.0020.01214.20
5.6.230.0100.00714.17
5.6.220.0100.00514.31
5.6.210.0050.04417.46
5.6.200.0090.02216.20
5.6.190.0080.03217.38
5.6.180.0240.03417.45
5.6.170.0110.02717.34
5.6.160.0060.02417.47
5.6.150.0040.02516.23
5.6.140.0120.03116.16
5.6.130.0120.01916.25
5.6.120.0130.03817.71
5.6.110.0170.03917.76
5.6.100.0090.03617.70
5.6.90.0190.03617.51
5.6.80.0070.04217.42
5.6.70.0070.00714.44
5.6.60.0040.01114.41
5.6.50.0100.00514.10
5.6.40.0100.00313.88
5.6.30.0040.00914.07
5.6.20.0100.00613.99
5.6.10.0170.00014.30
5.6.00.0070.00714.36
5.5.380.0130.00012.79
5.5.370.0050.00512.79
5.5.360.0030.00812.79
5.5.350.0180.03716.62
5.5.340.0060.04315.39
5.5.330.0070.03716.58
5.5.320.0050.03016.52
5.5.310.0140.02316.60
5.5.300.0090.04015.38
5.5.290.0070.04215.38
5.5.280.0090.03916.83
5.5.270.0120.03816.83
5.5.260.0070.04516.83
5.5.250.0110.04016.72
5.5.240.0100.03816.54
5.5.230.0060.00912.79
5.5.220.0130.00012.79
5.5.210.0080.00512.79
5.5.200.0110.00312.79
5.5.190.0090.00212.79
5.5.180.0030.01012.79
5.5.170.0110.00514.21
5.5.160.0090.00612.79
5.5.150.0120.00312.79
5.5.140.0080.00412.79
5.5.130.0120.00312.79
5.5.120.0060.00812.79
5.5.110.0070.00312.79
5.5.100.0040.00712.79
5.5.90.0090.00612.79
5.5.80.0100.00312.79
5.5.70.0120.00012.79
5.5.60.0070.00712.79
5.5.50.0090.00412.79
5.5.40.0070.00712.79
5.5.30.0040.00712.79
5.5.20.0100.00312.79
5.5.10.0130.00012.79
5.5.00.0040.00812.79
5.4.450.0090.02316.13
5.4.440.0060.02216.04
5.4.430.0060.02116.17
5.4.420.0100.01816.17
5.4.410.0040.02216.11
5.4.400.0040.02415.82
5.4.390.0050.02215.88
5.4.380.0060.02015.96
5.4.370.0060.02115.82
5.4.360.0080.03515.97
5.4.350.0050.04215.95
5.4.340.0090.02715.82
5.4.330.0080.00412.79
5.4.320.0080.04115.82
5.4.310.0090.03916.01
5.4.300.0050.04416.00
5.4.290.0070.02415.82
5.4.280.0120.03516.01
5.4.270.0130.03515.96
5.4.260.0100.03615.99
5.4.250.0090.02515.83
5.4.240.0100.03515.97
5.4.230.0050.04315.86
5.4.220.0100.03815.82
5.4.210.0110.03816.01
5.4.200.0110.03915.93
5.4.190.0090.02215.96
5.4.180.0070.03915.99
5.4.170.0090.03715.82
5.4.160.0060.03615.96
5.4.150.0070.04216.01
5.4.140.0070.03714.63
5.4.130.0060.03514.57
5.4.120.0090.03814.64
5.4.110.0090.03614.55
5.4.100.0120.02214.61
5.4.90.0050.02514.66
5.4.80.0090.03414.54
5.4.70.0090.02314.59
5.4.60.0110.02614.52
5.4.50.0050.03814.61
5.4.40.0110.03514.72
5.4.30.0150.03314.58
5.4.20.0100.02314.53
5.4.10.0060.03714.55
5.4.00.0090.03714.30
5.3.290.0030.03813.73
5.3.280.0140.03513.69
5.3.270.0110.03713.64
5.3.260.0050.03713.73
5.3.250.0070.02813.72
5.3.240.0060.03113.70
5.3.230.0080.03713.71
5.3.220.0090.03013.75
5.3.210.0090.03813.68
5.3.200.0040.03113.71
5.3.190.0090.04013.68
5.3.180.0120.01813.71
5.3.170.0110.02613.76
5.3.160.0130.03013.71
5.3.150.0140.03513.75
5.3.140.0120.03513.70
5.3.130.0080.04013.63
5.3.120.0070.03313.61
5.3.110.0040.03413.69
5.3.100.0040.03613.49
5.3.90.0070.03813.40
5.3.80.0060.04013.47
5.3.70.0080.02113.41
5.3.60.0080.02613.40
5.3.50.0090.02013.37
5.3.40.0070.04013.39
5.3.30.0030.04413.42
5.3.20.0050.04013.21
5.3.10.0020.03213.24
5.3.00.0040.03813.24
5.2.170.0120.02711.91
5.2.160.0030.02011.95
5.2.150.0040.02311.92
5.2.140.0010.03611.96
5.2.130.0090.03011.93
5.2.120.0080.03112.03
5.2.110.0040.02311.93
5.2.100.0080.01711.95
5.2.90.0040.01811.92
5.2.80.0030.01811.91
5.2.70.0030.01911.93
5.2.60.0070.02211.95
5.2.50.0030.03711.90
5.2.40.0040.02011.83
5.2.30.0060.02311.91
5.2.20.0070.03211.90
5.2.10.0020.03411.83
5.2.00.0060.03111.83
5.1.60.0030.03211.38
5.1.50.0040.02911.37
5.1.40.0020.01911.42
5.1.30.0090.02311.55
5.1.20.0060.02811.60
5.1.10.0040.01611.38
5.1.00.0050.01711.41
5.0.50.0020.01310.74
5.0.40.0020.02110.61
5.0.30.0050.03010.52
5.0.20.0040.02110.57
5.0.10.0040.01210.56
5.0.00.0060.03210.51
4.4.90.0050.01810.24
4.4.80.0020.02010.24
4.4.70.0070.01510.24
4.4.60.0020.02010.24
4.4.50.0020.01710.24
4.4.40.0050.01310.24
4.4.30.0020.02110.24
4.4.20.0040.01010.24
4.4.10.0030.01010.24
4.4.00.0040.01510.24
4.3.110.0020.01810.24
4.3.100.0040.01510.24
4.3.90.0030.02110.24
4.3.80.0010.02810.24
4.3.70.0030.02110.24
4.3.60.0020.02010.24
4.3.50.0000.01310.24
4.3.40.0050.02510.24
4.3.30.0030.01110.24
4.3.20.0030.01010.24
4.3.10.0020.01710.24
4.3.00.0030.01910.24

preferences:
53.51 ms | 401 KiB | 5 Q