3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_values_between($the_string, $starts_with, $ends_with) { if(strpos($the_string , $starts_with)===false) return array(); $the_string = substr($the_string,strpos($the_string , $starts_with)); //echo $the_string; $temp = array_filter(explode($starts_with, $the_string)); $result_array = array(); $inc = 0; foreach($temp as $a_start_match) { if (strlen($ends_with) <= strlen($a_start_match)) { // $a_start_match = substr($a_start_match,0,strpos($a_start_match , $ends_with)); echo substr($a_start_match, -strlen($ends_with))." against ".$ends_with."\n"; if(substr($a_start_match, -strlen($ends_with)) === $ends_with) { echo $a_start_match."\n"; $result_array[$inc]=$a_start_match; $inc++; } } } return $result_array; } $the_string = "some string here string_1ABCDEFGHstring2 some string here string_1IJKLMNOPQRSTstring2 some string here string_1UVWstring2XYZ"; $start = "string_1"; $end = "string2"; $result = get_values_between($the_string,$start,$end); //print_r($result);

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.0150.00316.75
8.3.60.0110.00418.16
8.3.50.0120.00722.05
8.3.40.0180.00418.80
8.3.30.0120.00318.78
8.3.20.0040.00418.73
8.3.10.0030.00621.09
8.3.00.0040.00423.61
8.2.180.0150.00416.38
8.2.170.0070.00722.96
8.2.160.0070.00720.45
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0040.00419.36
8.2.110.0070.00320.58
8.2.100.0040.00817.72
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0030.00517.50
8.2.60.0080.00018.04
8.2.50.0050.00318.07
8.2.40.0030.00618.16
8.2.30.0000.01119.84
8.2.20.0000.00717.52
8.2.10.0040.00417.63
8.2.00.0050.00517.81
8.1.280.0090.00625.92
8.1.270.0090.00023.99
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00422.45
8.1.230.0070.00420.96
8.1.220.0040.00418.77
8.1.210.0080.00018.95
8.1.200.0060.00317.35
8.1.190.0030.00617.50
8.1.180.0000.00918.10
8.1.170.0090.00018.50
8.1.160.0000.00718.89
8.1.150.0000.00718.57
8.1.140.0050.00217.37
8.1.130.0040.00417.76
8.1.120.0050.00217.46
8.1.110.0000.00817.38
8.1.100.0000.00817.48
8.1.90.0040.00417.41
8.1.80.0030.00517.42
8.1.70.0040.00417.35
8.1.60.0040.00417.60
8.1.50.0080.00017.50
8.1.40.0000.00817.52
8.1.30.0090.00017.59
8.1.20.0040.00417.63
8.1.10.0080.00017.59
8.1.00.0050.00517.34
8.0.300.0000.00720.02
8.0.290.0000.00717.18
8.0.280.0000.00718.32
8.0.270.0030.00317.27
8.0.260.0000.00816.82
8.0.250.0000.00716.86
8.0.240.0000.00816.94
8.0.230.0070.00016.89
8.0.220.0000.00716.93
8.0.210.0030.00316.76
8.0.200.0030.00316.96
8.0.190.0030.00416.86
8.0.180.0000.00816.80
8.0.170.0080.00016.76
8.0.160.0070.00016.91
8.0.150.0000.00816.84
8.0.140.0000.01116.88
8.0.130.0000.00513.35
8.0.120.0000.00716.80
8.0.110.0070.00016.79
8.0.100.0040.00416.72
8.0.90.0000.00716.96
8.0.80.0000.01516.96
8.0.70.0040.00416.91
8.0.60.0040.00416.93
8.0.50.0040.00416.94
8.0.30.0110.01217.13
8.0.20.0130.00517.40
8.0.10.0040.00417.04
8.0.00.0150.00516.80
7.4.330.0030.00314.84
7.4.320.0030.00316.66
7.4.300.0040.00416.59
7.4.290.0080.00016.58
7.4.280.0070.00016.42
7.4.270.0070.00016.52
7.4.260.0050.00013.30
7.4.250.0040.00416.52
7.4.240.0070.00016.43
7.4.230.0030.00316.69
7.4.220.0030.01516.50
7.4.210.0070.00916.55
7.4.200.0040.00416.63
7.4.190.0050.00516.56
7.4.160.0060.01216.59
7.4.150.0100.01117.40
7.4.140.0060.01217.86
7.4.130.0080.00816.46
7.4.120.0090.00816.45
7.4.110.0070.01116.49
7.4.100.0150.00316.72
7.4.90.0130.00316.63
7.4.80.0150.01019.37
7.4.70.0070.00416.57
7.4.60.0170.00316.61
7.4.50.0030.00616.57
7.4.40.0070.00722.27
7.4.30.0120.00716.54
7.4.00.0030.01215.06
7.3.330.0020.00213.15
7.3.320.0050.00013.23
7.3.310.0070.00016.24
7.3.300.0030.00316.24
7.3.290.0100.00316.41
7.3.280.0150.00216.36
7.3.270.0090.00917.40
7.3.260.0110.00718.24
7.3.250.0110.01316.51
7.3.240.0170.00316.22
7.3.230.0100.00716.44
7.3.210.0090.00916.37
7.3.200.0090.01319.39
7.3.190.0060.01116.61
7.3.180.0120.00316.33
7.3.170.0080.01216.40
7.3.160.0060.01016.46
7.3.120.0070.00014.86
7.2.330.0070.01016.46
7.2.320.0160.00016.76
7.2.310.0170.00716.80
7.2.300.0060.01116.78
7.2.290.0060.01616.58
7.2.00.0060.00919.40
7.1.100.0000.01118.25
7.1.70.0080.00017.14
7.1.60.0100.01419.40
7.1.50.0140.01117.04
7.1.00.0030.03322.31
7.0.200.0050.00216.53
7.0.140.0070.07022.08
7.0.70.0070.07721.77
7.0.60.0070.08021.61
7.0.50.0070.06722.14
7.0.40.0070.07020.03
7.0.30.0070.07320.08
7.0.20.0070.08320.13
7.0.10.0100.06320.09
7.0.00.0070.08020.10
5.6.220.0000.08720.61
5.6.210.0070.05020.64
5.6.200.0030.07321.06
5.6.190.0000.08321.18
5.6.180.0170.07721.04
5.6.170.0100.06020.94
5.6.160.0100.07720.96
5.6.150.0070.08321.11
5.6.140.0100.07321.03
5.6.130.0070.07720.95
5.6.120.0070.08721.02
5.6.110.0100.08320.95
5.6.100.0000.05321.02
5.6.90.0030.08721.02
5.6.80.0030.08720.43
5.6.70.0100.07020.43
5.6.60.0030.08020.40
5.6.50.0100.07020.50
5.6.40.0100.06320.41
5.6.30.0070.07320.45
5.6.20.0030.07720.29
5.6.10.0030.07720.43
5.6.00.0030.08320.36
5.5.360.0030.07720.52
5.5.350.0070.08720.33
5.5.340.0000.06720.93
5.5.330.0000.06320.85
5.5.320.0000.07020.92
5.5.310.0030.07320.84
5.5.300.0000.08720.76
5.5.290.0000.06020.84
5.5.280.0070.04320.91
5.5.270.0070.08320.93
5.5.260.0070.08720.86
5.5.250.0000.08020.64
5.5.240.0070.05720.13
5.5.230.0030.08320.26
5.5.220.0000.07720.32
5.5.210.0070.07720.31
5.5.200.0070.05020.26
5.5.190.0070.07020.15
5.5.180.0000.08320.27
5.5.160.0030.07020.13
5.5.150.0030.07020.24
5.5.140.0070.08020.27
5.5.130.0000.07319.96
5.5.120.0030.07320.21
5.5.110.0000.07720.27
5.5.100.0030.07320.13
5.5.90.0070.06720.08
5.5.80.0000.06020.10
5.5.70.0000.04720.05
5.5.60.0000.07019.97
5.5.50.0000.07720.10
5.5.40.0000.08019.94
5.5.30.0030.07720.15
5.5.20.0100.08020.09
5.5.10.0030.06020.09
5.5.00.0000.08019.96
5.4.450.0070.07719.42
5.4.440.0070.07719.52
5.4.430.0030.08319.46
5.4.420.0070.07719.41
5.4.410.0030.07719.28
5.4.400.0070.07019.15
5.4.390.0030.07719.13
5.4.380.0030.07319.16
5.4.370.0100.07018.90
5.4.360.0000.08319.21
5.4.350.0000.06719.18
5.4.340.0030.07318.85
5.4.320.0030.07018.84
5.4.310.0100.06719.20
5.4.300.0030.07019.10
5.4.290.0030.07719.04
5.4.280.0070.07318.90
5.4.270.0030.07719.07
5.4.260.0000.04718.94
5.4.250.0000.05019.08
5.4.240.0000.05319.14
5.4.230.0070.04719.17
5.4.220.0030.04718.83
5.4.210.0030.07319.13
5.4.200.0000.08019.02
5.4.190.0030.07019.14
5.4.180.0030.05719.19
5.4.170.0030.07718.83
5.4.160.0000.08018.92
5.4.150.0070.06319.02
5.4.140.0030.07716.29
5.4.130.0070.07716.29
5.4.120.0070.06016.36
5.4.110.0070.06016.50
5.4.100.0000.06016.28
5.4.90.0100.07016.27
5.4.80.0070.06716.41
5.4.70.0000.07016.34
5.4.60.0070.05316.44
5.4.50.0100.05716.33
5.4.40.0000.07716.37
5.4.30.0070.06716.36
5.4.20.0000.05716.38
5.4.10.0100.04716.36
5.4.00.0030.06715.73
5.3.290.0030.08014.77
5.3.280.0000.04014.71
5.3.270.0030.07714.72
5.3.260.0030.07714.73
5.3.250.0070.04714.59
5.3.240.0070.06314.61
5.3.230.0030.07314.67
5.3.220.0000.07314.56
5.3.210.0070.07714.60
5.3.200.0000.08014.55
5.3.190.0030.06014.56
5.3.180.0000.07014.59
5.3.170.0000.05314.70
5.3.160.0000.06714.69
5.3.150.0030.07314.66
5.3.140.0030.07314.57
5.3.130.0030.06314.49
5.3.120.0070.07314.58
5.3.110.0000.06714.53
5.3.100.0030.06714.16
5.3.90.0030.07313.96
5.3.80.0000.07314.05
5.3.70.0030.04014.05
5.3.60.0030.07014.12
5.3.50.0130.06314.02
5.3.40.0030.05713.98
5.3.30.0030.06714.02
5.3.20.0030.06713.84
5.3.10.0000.06313.69
5.3.00.0030.07313.57
5.2.170.0070.05711.14
5.2.160.0070.05711.14
5.2.150.0000.04711.20
5.2.140.0070.06011.03
5.2.130.0030.06311.13
5.2.120.0000.05710.99
5.2.110.0000.06311.21
5.2.100.0000.06011.21
5.2.90.0000.06711.24
5.2.80.0030.06011.20
5.2.70.0030.06010.99
5.2.60.0000.05711.18
5.2.50.0030.05710.91
5.2.40.0030.05311.07
5.2.30.0030.05711.04
5.2.20.0070.05711.11
5.2.10.0030.04311.01
5.2.00.0030.06010.78
5.1.60.0000.04010.12
5.1.50.0000.0539.84
5.1.40.0070.05010.01
5.1.30.0030.06010.39
5.1.20.0000.06010.26
5.1.10.0070.04710.13
5.1.00.0030.0479.92
5.0.50.0070.0379.82
5.0.40.0000.0309.82
5.0.30.0000.0609.82
5.0.20.0030.0479.82
5.0.10.0030.0379.82
5.0.00.0030.0409.82
4.4.90.0030.0379.82
4.4.80.0070.0339.82
4.4.70.0070.0309.82
4.4.60.0030.0339.82
4.4.50.0000.0339.82
4.4.40.0030.0539.82
4.4.30.0000.0279.82
4.4.20.0030.0379.82
4.4.10.0030.0279.82
4.4.00.0070.0479.82
4.3.110.0000.0439.82
4.3.100.0000.0379.82
4.3.90.0030.0339.82
4.3.80.0000.0509.82
4.3.70.0000.0139.82
4.3.60.0030.0139.82
4.3.50.0000.0309.82
4.3.40.0000.0409.82
4.3.30.0000.0209.82
4.3.20.0000.0379.82
4.3.10.0000.0309.82
4.3.00.0030.0279.82

preferences:
91.52 ms | 401 KiB | 5 Q