3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_between($input, $start, $end) { $temp = explode($start, $input); $result_array = array(); $inc = 0; foreach($temp as $a_start_match) { if (strlen($end <= strlen($a_start_match))) { if(substr($a_start_match, -strlen($end)) === $end) { $result_array[$inc]=$a_start_match; ++$inc; } } } return $result_array; } $the_string = "some string here string_1--------string2 some string here string_1--------string2 some string here string_1--------string2"; $a = "string_1"; $b = "string2"; print_R (get_between($the_string,$a,$b));

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.00618.14
8.3.50.0150.00517.24
8.3.40.0100.00718.84
8.3.30.0060.00918.38
8.3.20.0040.00418.66
8.3.10.0040.00420.53
8.3.00.0060.00319.17
8.2.180.0120.00616.50
8.2.170.0140.00022.96
8.2.160.0140.00020.34
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.54
8.2.110.0100.00020.94
8.2.100.0070.00317.72
8.2.90.0050.00319.26
8.2.80.0000.00718.05
8.2.70.0070.00317.34
8.2.60.0060.00317.80
8.2.50.0060.00318.07
8.2.40.0080.00020.01
8.2.30.0040.00418.13
8.2.20.0050.00217.55
8.2.10.0030.00717.75
8.2.00.0040.00417.80
8.1.280.0080.01125.92
8.1.270.0050.00224.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00520.64
8.1.230.0110.00020.88
8.1.220.0060.00318.77
8.1.210.0040.00418.99
8.1.200.0000.00917.36
8.1.190.0000.00717.53
8.1.180.0050.00318.10
8.1.170.0000.00818.91
8.1.160.0040.00418.82
8.1.150.0070.00018.56
8.1.140.0000.00717.36
8.1.130.0050.00217.78
8.1.120.0050.00317.43
8.1.110.0000.00717.45
8.1.100.0040.00417.47
8.1.90.0070.00017.36
8.1.80.0040.00417.48
8.1.70.0060.00317.44
8.1.60.0040.00417.62
8.1.50.0000.00717.46
8.1.40.0070.00017.46
8.1.30.0050.00317.62
8.1.20.0040.00417.48
8.1.10.0000.00817.54
8.1.00.0000.00817.47
8.0.300.0000.00719.89
8.0.290.0000.00716.75
8.0.280.0000.00718.33
8.0.270.0040.00417.28
8.0.260.0030.00316.70
8.0.250.0000.00816.99
8.0.240.0070.00316.84
8.0.230.0000.00716.84
8.0.220.0080.00016.80
8.0.210.0070.00016.80
8.0.200.0030.00316.92
8.0.190.0030.00616.96
8.0.180.0040.00417.00
8.0.170.0050.00416.89
8.0.160.0030.00416.91
8.0.150.0000.00816.87
8.0.140.0060.00316.80
8.0.130.0030.00313.29
8.0.120.0070.00316.80
8.0.110.0000.00716.91
8.0.100.0030.00516.95
8.0.90.0040.00416.78
8.0.80.0120.00316.86
8.0.70.0000.00716.92
8.0.60.0040.00416.90
8.0.50.0000.00716.93
8.0.30.0150.00617.07
8.0.20.0090.00917.16
8.0.10.0000.00716.94
8.0.00.0090.01216.88
7.4.330.0020.00213.03
7.4.320.0030.00316.65
7.4.300.0000.00616.47
7.4.290.0030.00316.56
7.4.280.0060.00316.63
7.4.270.0030.00616.61
7.4.260.0000.00613.30
7.4.250.0040.00416.51
7.4.240.0000.00716.60
7.4.230.0030.00316.45
7.4.220.0080.00816.48
7.4.210.0080.00816.59
7.4.200.0040.00416.68
7.4.190.0030.00316.65
7.4.160.0120.00316.56
7.4.150.0060.01616.58
7.4.140.0090.01216.52
7.4.130.0060.01116.53
7.4.120.0090.00816.52
7.4.110.0130.00716.61
7.4.100.0100.00616.49
7.4.90.0090.00916.52
7.4.80.0120.00616.67
7.4.70.0100.01316.38
7.4.60.0060.01216.67
7.4.50.0050.00016.30
7.4.40.0000.01316.62
7.4.30.0080.00816.43
7.4.10.0030.01214.88
7.4.00.0060.01015.04
7.3.330.0000.00613.36
7.3.320.0030.00313.18
7.3.310.0000.00616.26
7.3.300.0060.00016.22
7.3.290.0110.00316.38
7.3.280.0060.01216.35
7.3.270.0100.00716.41
7.3.260.0130.01116.57
7.3.250.0110.00916.33
7.3.240.0040.01416.30
7.3.230.0080.01516.57
7.3.210.0060.01016.56
7.3.200.0130.01119.39
7.3.190.0040.01516.58
7.3.180.0130.00316.63
7.3.170.0090.01316.61
7.3.160.0070.01516.45
7.3.130.0120.00314.82
7.3.120.0030.01414.77
7.3.110.0050.01314.67
7.3.100.0080.00614.97
7.3.90.0050.01014.75
7.3.80.0070.00514.73
7.3.70.0040.00714.93
7.3.60.0060.00814.89
7.3.50.0050.00614.85
7.3.40.0080.00314.82
7.3.30.0080.00514.66
7.3.20.0050.00616.88
7.3.10.0020.01516.76
7.3.00.0070.00716.75
7.2.330.0130.01016.78
7.2.320.0130.00316.87
7.2.310.0100.01016.50
7.2.300.0110.00716.55
7.2.290.0030.01316.59
7.2.260.0100.00715.29
7.2.250.0080.00815.12
7.2.240.0060.01214.99
7.2.230.0080.00815.09
7.2.220.0060.01014.97
7.2.210.0040.01115.09
7.2.200.0070.01014.95
7.2.190.0050.00915.16
7.2.180.0060.00814.95
7.2.170.0070.00815.00
7.2.160.0100.00714.97
7.2.150.0000.01316.93
7.2.140.0100.00016.82
7.2.130.0060.01016.96
7.2.120.0070.01017.00
7.2.110.0040.01216.84
7.2.100.0100.00616.84
7.2.90.0040.01117.11
7.2.80.0090.00617.00
7.2.70.0070.00716.91
7.2.60.0030.01416.98
7.2.50.0100.00716.88
7.2.40.0120.00316.82
7.2.30.0040.01117.06
7.2.20.0060.00916.79
7.2.10.0130.00317.04
7.2.00.0060.00616.97
7.1.330.0050.00815.82
7.1.320.0050.00915.80
7.1.310.0070.00715.85
7.1.300.0090.00415.57
7.1.290.0030.00815.88
7.1.280.0030.00915.72
7.1.270.0050.00415.77
7.1.260.0070.00715.76
7.1.250.0030.01315.87
7.1.240.0080.00415.61
7.1.230.0090.00615.55
7.1.220.0030.00615.70
7.1.210.0000.01115.81
7.1.200.0070.00716.01
7.1.190.0070.00715.90
7.1.180.0040.01215.96
7.1.170.0070.00715.87
7.1.160.0090.00615.88
7.1.150.0000.01215.80
7.1.140.0100.00615.79
7.1.130.0040.00415.97
7.1.120.0080.00415.79
7.1.110.0030.00715.93
7.1.100.0070.00717.10
7.1.90.0100.00316.07
7.1.80.0060.00615.54
7.1.70.0030.01016.56
7.1.60.0070.00917.72
7.1.50.0070.01216.54
7.1.40.0060.01216.04
7.1.30.0000.01415.84
7.1.20.0040.00415.86
7.1.10.0080.00415.74
7.1.00.0030.03119.12
7.0.330.0000.01515.42
7.0.320.0040.00415.44
7.0.310.0040.00415.45
7.0.300.0080.00515.36
7.0.290.0100.00315.14
7.0.280.0000.01315.22
7.0.270.0000.01215.24
7.0.260.0100.00015.45
7.0.250.0030.00615.14
7.0.240.0040.00815.41
7.0.230.0110.00015.34
7.0.220.0090.00615.55
7.0.210.0040.01115.45
7.0.200.0000.00916.11
7.0.190.0090.00615.32
7.0.180.0070.00815.41
7.0.170.0030.01015.39
7.0.160.0060.00915.50
7.0.150.0070.00315.47
7.0.140.0120.03318.72
7.0.130.0040.01115.51
7.0.120.0050.04118.89
7.0.110.0040.01215.49
7.0.100.0040.00715.34
7.0.90.0000.01315.29
7.0.80.0030.00915.63
7.0.70.0040.00415.58
7.0.60.0070.03517.61
7.0.50.0100.03316.82
7.0.40.0100.02516.87
7.0.30.0180.03216.93
7.0.20.0080.02816.94
7.0.10.0060.02616.88
7.0.00.0020.05116.78
5.6.400.0100.00314.48
5.6.390.0060.00314.69
5.6.380.0000.00914.50
5.6.370.0000.01114.19
5.6.360.0080.00614.30
5.6.350.0060.00814.51
5.6.340.0060.00614.31
5.6.330.0040.00814.36
5.6.320.0050.00514.55
5.6.310.0060.00614.65
5.6.300.0000.01414.62
5.6.290.0000.01114.35
5.6.280.0070.01114.33
5.6.270.0120.00314.18
5.6.260.0110.00014.48
5.6.250.0080.00414.30
5.6.240.0040.00714.57
5.6.230.0060.00314.50
5.6.220.0070.00314.21
5.6.210.0080.04017.44
5.6.200.0070.04416.47
5.6.190.0040.03817.52
5.6.180.0200.03217.37
5.6.170.0150.02717.46
5.6.160.0060.02117.35
5.6.150.0030.02916.30
5.6.140.0000.02716.29
5.6.130.0130.04116.22
5.6.120.0150.03017.80
5.6.110.0030.02617.77
5.6.100.0070.04517.92
5.6.90.0130.03917.55
5.6.80.0070.02217.27
5.6.70.0000.01714.36
5.6.60.0040.00814.27
5.6.50.0060.00614.23
5.6.40.0140.00414.68
5.6.30.0080.00614.43
5.6.20.0000.01014.60
5.6.10.0040.01114.66
5.6.00.0040.00414.41
5.5.380.0030.01014.33
5.5.370.0070.00314.49
5.5.360.0070.00314.30
5.5.350.0200.03517.44
5.5.340.0050.03616.06
5.5.330.0140.03817.36
5.5.320.0100.02517.47
5.5.310.0170.03817.38
5.5.300.0070.02416.09
5.5.290.0050.02316.12
5.5.280.0060.04117.65
5.5.270.0270.03517.68
5.5.260.0080.03517.51
5.5.250.0050.03017.55
5.5.240.0010.03017.35
5.5.230.0070.00314.47
5.5.220.0040.00814.37
5.5.210.0040.00814.46
5.5.200.0060.01014.55
5.5.190.0080.00414.41
5.5.180.0070.00714.34
5.5.170.0030.01314.20
5.5.160.0030.01014.49
5.5.150.0090.00314.27
5.5.140.0110.00414.34
5.5.130.0070.00714.54
5.5.120.0090.00314.40
5.5.110.0060.01014.17
5.5.100.0090.00614.40
5.5.90.0030.00814.39
5.5.80.0070.00314.07
5.5.70.0040.00814.11
5.5.60.0070.00714.44
5.5.50.0060.00314.32
5.5.40.0080.00014.33
5.5.30.0030.00914.38
5.5.20.0050.00514.43
5.5.10.0070.00613.80
5.5.00.0130.00314.43
5.4.450.0020.02315.30
5.4.440.0060.04015.32
5.4.430.0080.03815.20
5.4.420.0050.04315.41
5.4.410.0080.03015.43
5.4.400.0070.03815.16
5.4.390.0030.04215.31
5.4.380.0080.01815.05
5.4.370.0030.02415.07
5.4.360.0080.03515.18
5.4.350.0050.04314.98
5.4.340.0000.03315.20
5.4.330.0030.00911.05
5.4.320.0070.04315.20
5.4.310.0050.03015.28
5.4.300.0080.04214.96
5.4.290.0020.02915.14
5.4.280.0110.01915.10
5.4.270.0050.02214.93
5.4.260.0030.03815.16
5.4.250.0090.03715.07
5.4.240.0050.03115.17
5.4.230.0030.04515.07
5.4.220.0050.03715.26
5.4.210.0080.02315.10
5.4.200.0040.04215.02
5.4.190.0050.02714.97
5.4.180.0060.03615.31
5.4.170.0100.03115.03
5.4.160.0120.03015.00
5.4.150.0130.03615.17
5.4.140.0050.03213.65
5.4.130.0050.02613.79
5.4.120.0080.03013.82
5.4.110.0070.03813.79
5.4.100.0100.03513.62
5.4.90.0050.03813.91
5.4.80.0070.03813.78
5.4.70.0070.03213.95
5.4.60.0080.03313.84
5.4.50.0050.03913.83
5.4.40.0080.03413.73
5.4.30.0050.03813.84
5.4.20.0040.02413.86
5.4.10.0020.04413.69
5.4.00.0100.02513.65
5.3.290.0050.04612.65
5.3.280.0100.02512.62
5.3.270.0070.04212.63
5.3.260.0020.02412.71
5.3.250.0080.02012.50
5.3.240.0020.03012.56
5.3.230.0050.03712.65
5.3.220.0020.03512.56
5.3.210.0030.02212.61
5.3.200.0050.04112.49
5.3.190.0020.04712.60
5.3.180.0020.04112.69
5.3.170.0030.04412.63
5.3.160.0070.03612.67
5.3.150.0030.04012.65
5.3.140.0080.03012.60
5.3.130.0050.02912.58
5.3.120.0030.04712.64
5.3.110.0020.04612.71
5.3.100.0050.02712.36
5.3.90.0050.04012.27
5.3.80.0040.03012.35
5.3.70.0070.03212.28
5.3.60.0070.03212.23
5.3.50.0020.04612.15
5.3.40.0090.01812.28
5.3.30.0120.03312.21
5.3.20.0050.03812.14
5.3.10.0050.03712.00
5.3.00.0040.03212.01
5.2.170.0070.03711.29
5.2.160.0070.04711.29
5.2.150.0070.04311.03
5.2.140.0030.06311.29
5.2.130.0200.05011.16
5.2.120.0170.03311.11
5.2.110.0070.05711.16
5.2.100.0070.05311.05
5.2.90.0070.06011.15
5.2.80.0070.03011.25
5.2.70.0070.04311.01
5.2.60.0100.02711.01
5.2.50.0000.03711.07
5.2.40.0000.04710.91
5.2.30.0000.06010.98
5.2.20.0000.06710.84
5.2.10.0130.05010.75
5.2.00.0030.05010.86
5.1.60.0070.04010.07
5.1.50.0100.0509.98
5.1.40.0030.03010.04
5.1.30.0030.03010.41
5.1.20.0030.02710.40
5.1.10.0030.05710.15
5.1.00.0000.02710.05
5.0.50.0030.0278.61
5.0.40.0000.0378.56
5.0.30.0070.0538.37
5.0.20.0070.0238.29
5.0.10.0000.0508.29
5.0.00.0000.0678.29
4.4.90.0070.0238.29
4.4.80.0030.0208.29
4.4.70.0000.0208.29
4.4.60.0000.0378.29
4.4.50.0030.0338.29
4.4.40.0000.0338.29
4.4.30.0030.0138.29
4.4.20.0000.0208.29
4.4.10.0070.0338.29
4.4.00.0000.0308.29
4.3.110.0070.0338.29
4.3.100.0000.0278.29
4.3.90.0030.0208.29
4.3.80.0000.0578.29
4.3.70.0000.0238.29
4.3.60.0030.0138.29
4.3.50.0070.0278.29
4.3.40.0030.0308.29
4.3.30.0030.0338.29
4.3.20.0000.0308.29
4.3.10.0000.0378.29
4.3.00.0030.0238.29

preferences:
42.07 ms | 401 KiB | 5 Q