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)) { if(strpos($a_start_match , $ends_with)!==false) { $a_start_match = substr($a_start_match,0,strpos($a_start_match , $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_1UVWstring2"; $start = "string_1"; $end = "string2"; print_r(get_values_between($the_string,$start,$end));

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.0090.00918.26
8.3.50.0110.00321.92
8.3.40.0090.00618.55
8.3.30.0030.01118.96
8.3.20.0030.00520.34
8.3.10.0030.00621.95
8.3.00.0080.00022.46
8.2.180.0040.01516.36
8.2.170.0070.00722.96
8.2.160.0080.00620.97
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00819.25
8.2.110.0060.00321.02
8.2.100.0030.00917.72
8.2.90.0040.00419.17
8.2.80.0000.00818.03
8.2.70.0080.00417.38
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0000.00817.97
8.2.30.0060.00318.13
8.2.20.0000.00717.60
8.2.10.0000.00819.58
8.2.00.0000.00817.63
8.1.280.0140.00425.92
8.1.270.0050.00223.82
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00717.36
8.1.230.0030.00719.16
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.66
8.1.180.0030.00618.10
8.1.170.0040.00418.47
8.1.160.0040.00421.90
8.1.150.0000.00818.55
8.1.140.0040.00417.42
8.1.130.0000.00717.84
8.1.120.0000.00717.38
8.1.110.0000.00717.41
8.1.100.0000.00817.37
8.1.90.0000.00717.29
8.1.80.0040.00417.48
8.1.70.0050.00317.48
8.1.60.0040.00417.61
8.1.50.0030.00517.44
8.1.40.0000.00817.51
8.1.30.0070.00317.54
8.1.20.0040.00417.62
8.1.10.0040.00417.59
8.1.00.0040.00417.53
8.0.300.0000.00718.77
8.0.290.0000.00817.05
8.0.280.0080.00018.45
8.0.270.0040.00417.19
8.0.260.0030.00716.71
8.0.250.0030.00316.85
8.0.240.0000.00716.98
8.0.230.0070.00016.93
8.0.220.0000.00716.89
8.0.210.0030.00316.80
8.0.200.0030.00316.98
8.0.190.0040.00416.89
8.0.180.0040.00416.84
8.0.170.0050.00316.95
8.0.160.0080.00017.02
8.0.150.0040.00416.89
8.0.140.0030.00516.82
8.0.130.0030.00313.30
8.0.120.0080.00016.96
8.0.110.0070.00016.87
8.0.100.0080.00016.79
8.0.90.0000.00716.78
8.0.80.0130.00316.94
8.0.70.0040.00416.70
8.0.60.0040.00416.84
8.0.50.0030.00516.93
8.0.30.0080.01417.07
8.0.20.0150.00817.40
8.0.10.0070.00016.89
8.0.00.0150.00516.80
7.4.330.0000.00515.18
7.4.320.0030.00316.46
7.4.300.0030.00316.43
7.4.290.0040.00416.51
7.4.280.0000.00716.60
7.4.270.0040.00416.50
7.4.260.0020.00516.48
7.4.250.0000.00816.49
7.4.240.0040.00416.57
7.4.230.0030.00316.33
7.4.220.0040.01316.56
7.4.210.0090.00616.53
7.4.200.0030.00316.30
7.4.190.0030.00316.58
7.4.160.0000.01616.51
7.4.150.0160.00617.40
7.4.140.0100.00917.86
7.4.130.0110.00616.46
7.4.120.0080.01016.60
7.4.110.0100.00616.41
7.4.100.0100.00716.38
7.4.90.0120.00616.68
7.4.80.0070.01319.39
7.4.70.0030.01316.43
7.4.60.0080.00916.49
7.4.50.0000.00916.52
7.4.40.0040.01122.77
7.4.30.0080.00816.49
7.4.00.0030.01314.62
7.3.330.0050.00013.43
7.3.320.0000.00613.43
7.3.310.0000.00716.36
7.3.300.0000.00816.36
7.3.290.0060.00916.34
7.3.280.0080.01016.37
7.3.270.0100.00717.40
7.3.260.0130.00416.61
7.3.250.0110.01216.46
7.3.240.0070.01116.53
7.3.230.0110.00516.41
7.3.210.0100.00716.65
7.3.200.0060.01219.39
7.3.190.0070.01016.38
7.3.180.0040.01416.59
7.3.170.0040.01216.43
7.3.160.0100.01016.26
7.3.120.0000.01714.64
7.3.10.0060.01016.37
7.3.00.0030.00616.89
7.2.330.0110.00816.50
7.2.320.0080.01016.78
7.2.310.0060.01316.57
7.2.300.0130.00316.38
7.2.290.0140.00716.73
7.2.130.0000.01117.00
7.2.120.0080.00816.73
7.2.110.0130.00816.77
7.2.100.0080.00916.81
7.2.90.0150.00716.81
7.2.80.0240.00516.70
7.2.70.0120.00717.04
7.2.60.0120.00716.86
7.2.50.0140.00616.84
7.2.40.0070.00716.93
7.2.30.0110.00717.03
7.2.20.0160.00816.93
7.2.10.0110.00516.88
7.2.00.0080.00817.70
7.1.250.0150.00415.57
7.1.230.1460.00315.68
7.1.220.0100.00315.59
7.1.210.0140.00315.89
7.1.200.0120.00315.74
7.1.190.0130.00315.55
7.1.180.0100.00615.65
7.1.170.0040.00715.55
7.1.160.0140.00015.95
7.1.150.0100.00715.60
7.1.140.0140.01415.88
7.1.130.0000.01315.91
7.1.120.0060.00915.80
7.1.110.0100.00715.94
7.1.100.0100.00617.19
7.1.90.0060.00915.84
7.1.80.0150.00415.93
7.1.70.0110.00516.50
7.1.60.0120.00917.66
7.1.50.0100.01516.38
7.1.40.0120.00815.77
7.1.30.0150.00316.00
7.1.20.0170.00015.78
7.1.10.0110.00715.74
7.1.00.0060.04018.91
7.0.310.0090.00315.62
7.0.300.0040.00815.38
7.0.290.0130.00615.34
7.0.280.0050.01115.12
7.0.270.0030.00915.27
7.0.260.0090.00515.32
7.0.250.0460.00715.12
7.0.240.0120.00015.43
7.0.230.0070.01015.15
7.0.220.0160.00015.27
7.0.210.0150.00015.60
7.0.200.0090.00416.05
7.0.190.0070.00715.33
7.0.180.0180.00015.37
7.0.170.0150.00015.39
7.0.160.0090.00915.46
7.0.150.0120.00315.50
7.0.140.0030.04218.78
7.0.130.0150.00315.50
7.0.120.0350.01215.09
7.0.110.0140.00315.30
7.0.100.0070.04517.73
7.0.90.0100.02617.80
7.0.80.0130.04717.64
7.0.70.0060.02817.69
7.0.60.0070.03517.72
7.0.50.0070.04117.85
7.0.40.0080.03216.85
7.0.30.0070.04116.69
7.0.20.0080.03316.81
7.0.10.0070.02616.71
7.0.00.0030.04416.72
5.6.380.0140.00014.70
5.6.370.0090.00914.46
5.6.360.0100.01014.64
5.6.350.0040.01214.42
5.6.340.0150.00014.44
5.6.330.0160.00014.40
5.6.320.0140.00414.76
5.6.310.0100.00714.19
5.6.300.0140.00014.41
5.6.290.0110.00514.75
5.6.280.0090.03817.45
5.6.270.0140.00314.59
5.6.260.0110.00814.55
5.6.250.0030.04617.56
5.6.240.0110.02617.46
5.6.230.0070.03917.51
5.6.220.0080.04417.52
5.6.210.0040.02617.47
5.6.200.0080.04317.62
5.6.190.0030.02717.72
5.6.180.0090.04417.75
5.6.170.0060.04417.61
5.6.160.0120.03817.86
5.6.150.0080.02617.62
5.6.140.0130.03817.81
5.6.130.0070.04517.58
5.6.120.0140.03117.79
5.6.110.0080.03417.67
5.6.100.0090.04417.83
5.6.90.0140.04017.68
5.6.80.0120.03917.41
5.6.70.0080.03117.33
5.6.60.0090.04317.34
5.6.50.0140.03317.53
5.6.40.0110.03917.37
5.6.30.0140.03917.43
5.6.20.0090.04117.40
5.6.10.0060.02617.37
5.6.00.0090.04517.34
5.5.380.0080.04116.59
5.5.370.0060.02616.58
5.5.360.0080.04216.58
5.5.350.0080.02716.61
5.5.340.0030.05116.84
5.5.330.0070.04516.81
5.5.320.0120.03216.83
5.5.310.0090.03816.84
5.5.300.0090.04316.84
5.5.290.0080.03016.78
5.5.280.0060.02816.85
5.5.270.0120.04016.81
5.5.260.0080.04516.85
5.5.250.0090.02516.69
5.5.240.0040.04216.55
5.5.230.0070.03916.54
5.5.220.0070.04216.46
5.5.210.0080.03516.52
5.5.200.0110.04016.49
5.5.190.0120.03616.53
5.5.180.0050.04316.50
5.5.170.0110.00514.32
5.5.160.0090.02516.50
5.5.150.0110.02716.47
5.5.140.0080.03516.48
5.5.130.0100.02216.52
5.5.120.0120.03516.50
5.5.110.0130.04016.50
5.5.100.0060.02616.47
5.5.90.0080.02416.47
5.5.80.0140.03516.48
5.5.70.0060.02516.45
5.5.60.0060.02616.41
5.5.50.0050.02716.47
5.5.40.0110.01716.42
5.5.30.0080.02316.47
5.5.20.0030.02716.41
5.5.10.0100.01716.40
5.5.00.0060.02316.39
5.4.450.0060.02616.10
5.4.440.0060.02516.07
5.4.430.0090.03815.98
5.4.420.0070.04316.04
5.4.410.0070.02116.07
5.4.400.0070.03315.91
5.4.390.0130.03515.94
5.4.380.0110.03716.00
5.4.370.0080.02815.96
5.4.360.0050.04215.98
5.4.350.0110.02115.91
5.4.340.0050.04015.94
5.4.330.0060.00312.79
5.4.320.0040.02715.91
5.4.310.0110.03415.83
5.4.300.0050.04115.96
5.4.290.0040.03215.83
5.4.280.0070.03815.84
5.4.270.0170.03015.98
5.4.260.0140.02215.98
5.4.250.0030.03015.91
5.4.240.0140.02515.97
5.4.230.0080.02015.95
5.4.220.0100.02215.95
5.4.210.0070.02515.91
5.4.200.0030.02415.81
5.4.190.0080.02315.97
5.4.180.0020.02615.81
5.4.170.0060.02215.97
5.4.160.0090.02015.95
5.4.150.0030.02615.82
5.4.140.0090.01814.61
5.4.130.0080.01814.56
5.4.120.0000.02414.64
5.4.110.0060.02014.57
5.4.100.0070.02014.65
5.4.90.0060.01814.64
5.4.80.0040.02114.57
5.4.70.0100.01614.67
5.4.60.0070.02214.54
5.4.50.0070.01714.60
5.4.40.0070.02814.57
5.4.30.0060.02514.61
5.4.20.0090.01814.55
5.4.10.0060.04114.56
5.4.00.0080.01514.28
5.3.290.0100.03613.71
5.3.280.0050.01913.75
5.3.270.0040.02313.72
5.3.260.0040.02213.71
5.3.250.0070.01813.74
5.3.240.0040.02113.69
5.3.230.0080.02113.75
5.3.220.0040.02113.68
5.3.210.0060.01813.71
5.3.200.0050.02213.66
5.3.190.0040.01913.72
5.3.180.0100.01813.71
5.3.170.0040.01913.69
5.3.160.0060.02213.67
5.3.150.0030.02313.66
5.3.140.0060.02313.63
5.3.130.0060.02613.74
5.3.120.0030.02713.73
5.3.110.0040.02413.67
5.3.100.0090.01813.38
5.3.90.0120.01413.47
5.3.80.0070.01813.41
5.3.70.0090.03213.40
5.3.60.0080.01813.34
5.3.50.0090.01613.38
5.3.40.0040.02413.36
5.3.30.0070.01813.31
5.3.20.0050.01813.19
5.3.10.0050.01813.27
5.3.00.0060.02013.23
5.2.170.0050.01311.90
5.2.160.0050.01512.03
5.2.150.0040.01811.91
5.2.140.0020.01612.04
5.2.130.0050.01311.96
5.2.120.0050.01511.90
5.2.110.0020.01612.00
5.2.100.0080.01211.99
5.2.90.0060.01411.97
5.2.80.0040.01511.92
5.2.70.0040.02111.90
5.2.60.0070.01311.88
5.2.50.0050.01311.86
5.2.40.0060.01411.95
5.2.30.0030.01611.88
5.2.20.0020.01411.90
5.2.10.0060.01111.78
5.2.00.0030.01811.81
5.1.60.0020.01311.39
5.1.50.0030.01211.44
5.1.40.0020.01611.39
5.1.30.0020.01311.61
5.1.20.0070.01211.62
5.1.10.0040.01211.42
5.1.00.0020.01411.46
5.0.50.0030.01111.30
5.0.40.0030.01111.30
5.0.30.0000.02911.30
5.0.20.0060.02311.30
5.0.10.0050.01711.30
5.0.00.0030.03211.30
4.4.90.0000.01111.30
4.4.80.0030.00711.30
4.4.70.0020.00911.30
4.4.60.0060.01211.30
4.4.50.0030.00811.30
4.4.40.0030.01211.30
4.4.30.0020.01211.30
4.4.20.0020.00811.30
4.4.10.0000.01211.30
4.4.00.0060.01211.30
4.3.110.0020.01111.30
4.3.100.0020.01111.30
4.3.90.0060.01711.30
4.3.80.0060.02611.30
4.3.70.0000.01611.30
4.3.60.0040.01311.30
4.3.50.0020.01411.30
4.3.40.0070.02011.30
4.3.30.0000.01811.30
4.3.20.0010.01811.30
4.3.10.0020.02011.30
4.3.00.0010.01811.30

preferences:
48.01 ms | 401 KiB | 5 Q