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; } } } 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.00616.75
8.3.50.0090.01217.44
8.3.40.0090.00618.80
8.3.30.0110.00418.67
8.3.20.0040.00418.82
8.3.10.0050.00320.40
8.3.00.0080.00017.25
8.2.180.0070.00718.34
8.2.170.0210.00022.96
8.2.160.0120.00321.99
8.2.150.0000.00724.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0130.01017.91
8.2.110.0030.00720.38
8.2.100.0040.00717.91
8.2.90.0030.00519.27
8.2.80.0050.00317.97
8.2.70.0090.00017.50
8.2.60.0040.00417.65
8.2.50.0000.00818.07
8.2.40.0000.00818.22
8.2.30.0040.00417.97
8.2.20.0000.00717.66
8.2.10.0040.00717.83
8.2.00.0030.00717.75
8.1.280.0040.01125.92
8.1.270.0000.00723.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00423.92
8.1.230.0120.00017.42
8.1.220.0050.00317.79
8.1.210.0060.00318.77
8.1.200.0000.00917.35
8.1.190.0000.00717.41
8.1.180.0040.00418.10
8.1.170.0040.00418.75
8.1.160.0050.00318.82
8.1.150.0040.00418.56
8.1.140.0050.00217.52
8.1.130.0030.00317.75
8.1.120.0000.00717.43
8.1.110.0050.00317.35
8.1.100.0080.00017.37
8.1.90.0040.00417.43
8.1.80.0040.00417.50
8.1.70.0050.00217.44
8.1.60.0050.00317.63
8.1.50.0050.00217.37
8.1.40.0040.00417.54
8.1.30.0040.00417.71
8.1.20.0040.00417.56
8.1.10.0070.00017.42
8.1.00.0040.00417.44
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00318.51
8.0.270.0000.00717.23
8.0.260.0000.00616.87
8.0.250.0040.00416.93
8.0.240.0080.00416.88
8.0.230.0000.00716.90
8.0.220.0000.00716.93
8.0.210.0000.00716.87
8.0.200.0000.00716.92
8.0.190.0020.00516.96
8.0.180.0040.00416.92
8.0.170.0030.00716.80
8.0.160.0030.00316.77
8.0.150.0040.00416.88
8.0.140.0040.00416.82
8.0.130.0030.00313.31
8.0.120.0040.00416.83
8.0.110.0030.00316.93
8.0.100.0000.00716.84
8.0.90.0000.00716.85
8.0.80.0060.01316.96
8.0.70.0050.00316.77
8.0.60.0000.00716.76
8.0.50.0030.00316.76
8.0.30.0130.00517.00
8.0.20.0090.00916.89
8.0.10.0040.00416.91
8.0.00.0100.00816.71
7.4.330.0030.00313.00
7.4.320.0030.00316.61
7.4.300.0040.00416.59
7.4.290.0000.00716.60
7.4.280.0000.00916.47
7.4.270.0000.00716.49
7.4.260.0050.00013.23
7.4.250.0060.00316.53
7.4.240.0000.00716.53
7.4.230.0000.00716.63
7.4.220.0130.00316.56
7.4.210.0080.00816.53
7.4.200.0030.00316.59
7.4.190.0000.00716.48
7.4.160.0090.00616.64
7.4.150.0130.00716.56
7.4.140.0180.01116.53
7.4.130.0160.00316.56
7.4.120.0100.00616.43
7.4.110.0030.01416.32
7.4.100.0100.00716.60
7.4.90.0090.01016.52
7.4.80.0070.01616.27
7.4.70.0160.00616.43
7.4.60.0030.01316.66
7.4.50.0060.00316.40
7.4.40.0040.00716.70
7.4.30.0100.00616.58
7.4.00.0090.00614.75
7.3.330.0030.00313.37
7.3.320.0000.00613.37
7.3.310.0030.00316.38
7.3.300.0030.00316.23
7.3.290.0070.00716.33
7.3.280.0130.00616.37
7.3.270.0150.00316.62
7.3.260.0070.01416.53
7.3.250.0080.01016.50
7.3.240.0030.01416.41
7.3.230.0130.00316.33
7.3.210.0100.00616.60
7.3.200.0060.01019.39
7.3.190.0000.02316.36
7.3.180.0160.00016.30
7.3.170.0060.01016.67
7.3.160.0130.00316.50
7.3.120.0040.01414.86
7.2.330.0110.01116.78
7.2.320.0100.00716.85
7.2.310.0100.01016.47
7.2.300.0130.00316.64
7.2.290.0130.00716.41
7.2.00.0080.01419.54
7.1.100.0060.01018.38
7.1.70.0030.00617.01
7.1.60.0070.01119.40
7.1.50.0030.01716.97
7.1.00.0030.05722.54
7.0.200.0000.00816.79
7.0.140.0070.07022.12
7.0.120.0070.07022.02
7.0.60.0130.03020.02
7.0.50.0070.07317.86
7.0.40.0130.07319.98
7.0.30.0270.04320.15
7.0.20.0270.07320.10
7.0.10.0130.07720.10
7.0.00.0030.05320.33
5.6.280.0000.08020.78
5.6.210.0100.07320.46
5.6.200.0070.08718.28
5.6.190.0170.08020.61
5.6.180.0270.07720.55
5.6.170.0100.05020.52
5.6.160.0030.09020.47
5.6.150.0030.04018.17
5.6.140.0070.05018.21
5.6.130.0100.08318.15
5.6.120.0070.05020.97
5.6.110.0070.08321.00
5.6.100.0100.07721.14
5.6.90.0200.07321.11
5.6.80.0100.07320.39
5.5.350.0300.07720.41
5.5.340.0100.06317.98
5.5.330.0000.04320.35
5.5.320.0170.04020.25
5.5.310.0400.07020.51
5.5.300.0000.04717.98
5.5.290.0070.03717.94
5.5.280.0130.07720.91
5.5.270.0130.07720.80
5.5.260.0100.08720.77
5.5.250.0100.08720.60
5.5.240.0030.07720.16
5.4.450.0070.08019.54
5.4.440.0100.06719.40
5.4.430.0100.08019.17
5.4.420.0070.04019.52
5.4.410.0100.08319.36
5.4.400.0030.07318.98
5.4.390.0030.05319.24
5.4.380.0100.07319.20
5.4.370.0070.08019.15
5.4.360.0000.07018.87
5.4.350.0000.04319.15
5.4.340.0070.03719.08
5.4.320.0030.06719.08
5.4.310.0070.04319.23
5.4.300.0030.05019.16
5.4.290.0030.06319.14
5.4.280.0070.07318.85
5.4.270.0070.07719.09
5.4.260.0100.06718.85
5.4.250.0100.07018.97
5.4.240.0070.08018.84
5.4.230.0100.07719.14
5.4.220.0070.06018.86
5.4.210.0000.05319.24
5.4.200.0000.05318.84
5.4.190.0100.04019.14
5.4.180.0070.05019.23
5.4.170.0030.05719.25
5.4.160.0070.08318.98
5.4.150.0130.06319.23
5.4.140.0030.05016.41
5.4.130.0070.07316.37
5.4.120.0030.05316.37
5.4.110.0100.07016.37
5.4.100.0100.06016.67
5.4.90.0130.03716.53
5.4.80.0130.06716.44
5.4.70.0070.06716.66
5.4.60.0100.06016.37
5.4.50.0170.07016.35
5.4.40.0030.07716.31
5.4.30.0000.07716.25
5.4.20.0000.07716.48
5.4.10.0070.04316.40
5.4.00.0070.07015.99
5.3.290.0070.07014.66
5.3.280.0100.07314.64
5.3.270.0070.05314.62
5.3.260.0130.07714.58
5.3.250.0100.07314.66
5.3.240.0070.04014.61
5.3.230.0100.07314.74
5.3.220.0100.06314.61
5.3.210.0070.08014.50
5.3.200.0100.07314.57
5.3.190.0030.08014.45
5.3.180.0030.05014.59
5.3.170.0170.06714.59
5.3.160.0030.08314.56
5.3.150.0100.05714.59
5.3.140.0070.04314.61
5.3.130.0070.07314.54
5.3.120.0130.05714.59
5.3.110.0030.05014.55
5.3.100.0030.06714.04
5.3.90.0030.07714.00
5.3.80.0030.07714.03
5.3.70.0100.05314.02
5.3.60.0000.05013.97
5.3.50.0100.07013.96
5.3.40.0030.05314.02
5.3.30.0130.06713.82
5.3.20.0100.06313.66
5.3.10.0000.05713.58
5.3.00.0100.05713.80
5.2.170.0070.04711.20
5.2.160.0070.06311.20
5.2.150.0070.04011.21
5.2.140.0030.03311.20
5.2.130.0000.03711.07
5.2.120.0030.06011.10
5.2.110.0030.03311.02
5.2.100.0030.03011.16
5.2.90.0000.06311.14
5.2.80.0100.05711.13
5.2.70.0030.05010.98
5.2.60.0030.06710.94
5.2.50.0030.06010.96
5.2.40.0070.04011.03
5.2.30.0070.03310.93
5.2.20.0030.03010.95
5.2.10.0100.02710.89
5.2.00.0070.02710.68
5.1.60.0030.0239.95
5.1.50.0070.04310.14
5.1.40.0000.0439.94
5.1.30.0030.03710.34
5.1.20.0100.05010.34
5.1.10.0100.03710.12
5.1.00.0030.04710.08
5.0.50.0000.0438.45
5.0.40.0070.0408.40
5.0.30.0030.0538.25
5.0.20.0000.0208.26
5.0.10.0030.0238.17
5.0.00.0000.0308.13
4.4.90.0000.0378.06
4.4.80.0070.0238.06
4.4.70.0070.0308.06
4.4.60.0000.0378.06
4.4.50.0000.0178.06
4.4.40.0030.0338.06
4.4.30.0070.0338.06
4.4.20.0000.0438.06
4.4.10.0030.0178.06
4.4.00.0000.0378.06
4.3.110.0000.0208.06
4.3.100.0030.0238.06
4.3.90.0000.0178.06
4.3.80.0000.0278.06
4.3.70.0000.0138.06
4.3.60.0000.0138.06
4.3.50.0000.0178.06
4.3.40.0000.0238.06
4.3.30.0030.0138.06
4.3.20.0030.0138.06
4.3.10.0030.0138.06
4.3.00.0030.0108.06

preferences:
59.41 ms | 401 KiB | 5 Q