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)); $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)); if(substr($a_start_match, -strlen($ends_with)) === $ends_with) { $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_1UVWXYZstring2"; $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.60.0110.00716.38
8.3.50.0160.00716.42
8.3.40.0150.00018.71
8.3.30.0070.00718.62
8.3.20.0040.00418.52
8.3.10.0090.00020.48
8.3.00.0080.00019.13
8.2.180.0100.01016.46
8.2.170.0070.00722.96
8.2.160.0040.01118.85
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0040.00418.82
8.2.110.0080.00320.35
8.2.100.0040.00817.78
8.2.90.0030.00619.09
8.2.80.0030.00517.97
8.2.70.0030.00617.63
8.2.60.0060.00318.03
8.2.50.0000.00818.10
8.2.40.0080.00020.54
8.2.30.0000.00819.83
8.2.20.0030.00619.38
8.2.10.0000.00817.84
8.2.00.0050.00217.86
8.1.270.0050.00324.66
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0090.00022.87
8.1.230.0070.00417.76
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0060.00617.22
8.1.190.0000.00917.35
8.1.180.0040.00418.10
8.1.170.0050.00518.66
8.1.160.0030.00522.05
8.1.150.0030.00518.59
8.1.140.0000.00717.42
8.1.130.0030.00317.83
8.1.120.0040.00817.28
8.1.110.0040.00417.39
8.1.100.0000.00817.41
8.1.90.0040.00417.44
8.1.80.0040.00417.43
8.1.70.0000.00717.46
8.1.60.0040.00417.62
8.1.50.0040.00417.46
8.1.40.0090.00017.55
8.1.30.0000.00717.55
8.1.20.0000.00817.59
8.1.10.0000.00817.41
8.1.00.0000.00817.43
8.0.300.0050.00318.77
8.0.290.0000.00816.63
8.0.280.0030.00318.50
8.0.270.0040.00417.18
8.0.260.0030.00316.83
8.0.250.0000.00717.03
8.0.240.0040.00416.93
8.0.230.0000.00716.97
8.0.220.0000.00716.82
8.0.210.0000.00716.95
8.0.200.0000.00716.96
8.0.190.0000.00816.86
8.0.180.0040.00416.96
8.0.170.0000.00916.88
8.0.160.0040.00416.89
8.0.150.0030.00516.88
8.0.140.0080.00016.89
8.0.130.0050.00013.26
8.0.120.0070.00016.89
8.0.110.0070.00016.88
8.0.100.0000.00716.96
8.0.90.0040.00416.77
8.0.80.0070.01116.94
8.0.70.0070.00016.82
8.0.60.0000.00716.74
8.0.50.0070.00316.76
8.0.30.0030.01617.08
8.0.20.0080.01417.24
8.0.10.0040.00416.92
8.0.00.0160.00916.82
7.4.330.0000.00513.03
7.4.320.0000.00616.43
7.4.300.0070.00016.51
7.4.290.0000.00716.63
7.4.280.0040.00416.60
7.4.270.0000.00816.53
7.4.260.0030.00313.23
7.4.250.0050.00216.50
7.4.240.0030.00316.48
7.4.230.0030.00516.59
7.4.220.0060.01616.46
7.4.210.0130.00316.48
7.4.200.0020.00516.59
7.4.190.0050.00216.70
7.4.160.0110.00416.54
7.4.150.0150.00616.52
7.4.140.0070.01016.52
7.4.130.0070.01416.38
7.4.120.0110.00816.65
7.4.110.0060.01016.44
7.4.100.0100.01016.56
7.4.90.0060.01716.35
7.4.80.0100.00719.39
7.4.70.0080.00816.25
7.4.60.0000.01516.49
7.4.50.0060.00316.58
7.4.40.0090.00616.46
7.4.30.0070.01016.73
7.4.00.0110.00714.77
7.3.330.0000.00513.35
7.3.320.0050.00013.35
7.3.310.0000.00716.41
7.3.300.0020.00516.46
7.3.290.0080.00716.35
7.3.280.0100.00716.36
7.3.270.0050.01016.38
7.3.260.0060.01216.53
7.3.250.0140.00816.32
7.3.240.0070.01016.61
7.3.230.0080.00816.70
7.3.210.0060.01016.33
7.3.200.0090.00916.44
7.3.190.0030.01316.49
7.3.180.0100.00516.66
7.3.170.0120.00616.36
7.3.160.0040.01216.30
7.3.120.0070.01014.65
7.2.330.0150.00616.56
7.2.320.0110.00716.64
7.2.310.0070.01016.88
7.2.300.0070.01116.43
7.2.290.0160.00016.88
7.2.00.0030.01019.37
7.1.100.0050.00518.05
7.1.70.0070.00317.15
7.1.60.0100.01419.31
7.1.50.0090.01216.93
7.1.00.0030.05022.36
7.0.200.0040.00416.77
7.0.140.0070.07022.05
7.0.120.0030.07322.04
7.0.110.0070.04020.04
7.0.100.0030.04719.97
7.0.90.0000.06019.86
7.0.80.0030.04019.98
7.0.70.0100.03719.94
7.0.60.0000.04720.04
7.0.50.0130.03320.07
7.0.40.0030.03319.88
7.0.30.0030.03319.75
7.0.20.0030.03319.74
7.0.10.0030.03719.74
7.0.00.0000.03719.70
5.6.280.0070.07020.99
5.6.260.0030.03720.61
5.6.250.0070.03720.73
5.6.240.0030.07320.63
5.6.230.0070.04020.64
5.6.220.0000.04320.64
5.6.210.0070.04020.72
5.6.200.0070.04020.62
5.6.190.0070.03020.70
5.6.180.0030.03720.57
5.6.170.0030.03320.59
5.6.160.0030.03720.46
5.6.150.0030.03320.70
5.6.140.0000.03720.80
5.6.130.0070.03320.86
5.6.120.0030.03320.69
5.6.110.0070.05720.61
5.6.100.0100.03020.63
5.6.90.0030.04320.53
5.6.80.0130.03719.99
5.6.70.0030.03320.05
5.6.60.0030.03320.02
5.6.50.0100.03320.04
5.6.40.0100.03019.92
5.6.30.0100.02720.01
5.6.20.0000.04020.04
5.6.10.0000.03320.01
5.6.00.0030.03720.02
5.5.380.0030.06717.59
5.5.370.0070.03717.56
5.5.360.0100.03317.67
5.5.350.0030.06717.62
5.5.340.0000.04318.23
5.5.330.0030.04017.95
5.5.320.0030.03718.13
5.5.310.0100.03717.93
5.5.300.0030.03718.10
5.5.290.0070.03017.91
5.5.280.0070.03018.23
5.5.270.0030.03718.08
5.5.260.0030.08018.12
5.5.250.0030.03317.86
5.5.240.0100.03017.62
5.5.230.0030.04017.50
5.5.220.0030.03317.23
5.5.210.0070.03317.31
5.5.200.0000.03317.29
5.5.190.0000.03317.28
5.5.180.0000.03317.29
5.5.160.0030.03017.27
5.5.150.0000.03317.42
5.5.140.0030.03017.26
5.5.130.0000.03317.57
5.5.120.0070.02717.57
5.5.110.0100.02717.47
5.5.100.0030.03717.09
5.5.90.0030.03317.40
5.5.80.0070.02717.47
5.5.70.0000.03317.07
5.5.60.0070.02717.34
5.5.50.0030.03017.32
5.5.40.0000.03317.36
5.5.30.0070.03017.46
5.5.20.0000.03317.46
5.5.10.0100.03017.12
5.5.00.0000.05017.34
5.4.450.0000.03719.31
5.4.440.0070.03319.30
5.4.430.0030.04719.33
5.4.420.0070.03019.48
5.4.410.0000.04319.43
5.4.400.0000.04019.18
5.4.390.0030.04019.03
5.4.380.0030.03718.99
5.4.370.0070.03319.18
5.4.360.0030.03319.02
5.4.350.0030.03319.00
5.4.340.0000.03319.16
5.4.320.0000.03318.99
5.4.310.0000.03319.02
5.4.300.0000.03319.09
5.4.290.0000.03719.20
5.4.280.0030.03318.98
5.4.270.0100.02719.03
5.4.260.0130.02719.01
5.4.250.0000.03719.33
5.4.240.0070.02719.02
5.4.230.0030.03719.00
5.4.220.0070.04018.99
5.4.210.0100.02319.08
5.4.200.0030.03319.30
5.4.190.0030.03719.01
5.4.180.0030.03018.97
5.4.170.0000.05319.23
5.4.160.0170.06319.15
5.4.150.0170.06719.17
5.4.140.0030.04016.29
5.4.130.0070.04316.31
5.4.120.0070.07016.51
5.4.110.0100.07316.31
5.4.100.0100.07016.59
5.4.90.0000.03716.43
5.4.80.0070.03316.30
5.4.70.0030.04716.57
5.4.60.0030.03016.40
5.4.50.0070.06016.54
5.4.40.0100.02716.44
5.4.30.0100.03016.40
5.4.20.0130.06716.55
5.4.10.0030.03016.43
5.4.00.0070.02715.79
5.3.290.0070.03014.66
5.3.280.0000.03314.72
5.3.270.0070.04314.58
5.3.260.0030.04714.63
5.3.250.0030.03314.63
5.3.240.0000.04014.46
5.3.230.0100.07314.45
5.3.220.0030.04714.69
5.3.210.0030.05714.79
5.3.200.0170.02314.58
5.3.190.0030.05314.65
5.3.180.0000.04014.59
5.3.170.0070.03014.58
5.3.160.0070.05714.65
5.3.150.0030.03714.69
5.3.140.0000.04714.52
5.3.130.0130.02714.63
5.3.120.0000.04014.77
5.3.110.0030.03014.56
5.3.100.0000.03314.13
5.3.90.0030.03314.12
5.3.80.0070.03014.16
5.3.70.0000.04014.10
5.3.60.0070.03314.02
5.3.50.0030.03014.02
5.3.40.0030.03014.03
5.3.30.0000.03314.00
5.3.20.0100.04013.75
5.3.10.0000.04013.74
5.3.00.0070.03013.65
5.2.170.0000.02712.05
5.2.160.0000.03012.05
5.2.150.0000.04012.05
5.2.140.0000.03012.05
5.2.130.0030.02312.05
5.2.120.0000.05012.05
5.2.110.0070.02712.05
5.2.100.0030.02312.05
5.2.90.0000.03312.05
5.2.80.0070.02312.05
5.2.70.0070.02712.05
5.2.60.0030.02712.05
5.2.50.0030.02312.05
5.2.40.0070.04312.05
5.2.30.0000.04312.05
5.2.20.0000.02712.05
5.2.10.0000.02712.05
5.2.00.0000.04312.05
5.1.60.0000.02712.05
5.1.50.0070.01712.05
5.1.40.0030.02312.05
5.1.30.0100.05312.05
5.1.20.0030.05312.05
5.1.10.0000.02712.05
5.1.00.0030.02012.05
5.0.50.0030.02312.05
5.0.40.0070.01012.05
5.0.30.0000.03012.05
5.0.20.0000.02012.05
5.0.10.0000.01712.05
5.0.00.0000.03312.05
4.4.90.0000.01712.05
4.4.80.0000.04012.05
4.4.70.0000.01312.05
4.4.60.0000.01312.05
4.4.50.0000.01712.05
4.4.40.0000.02012.05
4.4.30.0000.02012.05
4.4.20.0030.01012.05
4.4.10.0030.01312.05
4.4.00.0030.02312.05
4.3.110.0030.01012.05
4.3.100.0000.01312.05
4.3.90.0070.01012.05
4.3.80.0000.02712.05
4.3.70.0000.01312.05
4.3.60.0000.01312.05
4.3.50.0000.01312.05
4.3.40.0070.02012.05
4.3.30.0000.01312.05
4.3.20.0000.01712.05
4.3.10.0000.02712.05
4.3.00.0030.01312.05

preferences:
62.74 ms | 400 KiB | 5 Q