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.40.0070.01418.56
8.3.30.0080.00818.96
8.3.20.0040.00420.25
8.3.10.0050.00321.98
8.3.00.0100.00022.38
8.2.170.0110.01122.96
8.2.160.0070.00720.97
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.36
8.2.110.0030.00620.55
8.2.100.0070.00317.72
8.2.90.0000.00819.22
8.2.80.0040.00417.97
8.2.70.0000.01017.63
8.2.60.0050.00318.04
8.2.50.0050.00318.07
8.2.40.0050.00318.22
8.2.30.0000.00718.13
8.2.20.0040.00417.75
8.2.10.0050.00317.63
8.2.00.0070.00017.81
8.1.270.0060.00323.97
8.1.260.0040.00426.35
8.1.250.0120.00028.09
8.1.240.0070.00323.60
8.1.230.0070.00322.15
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0040.00417.50
8.1.180.0030.00618.10
8.1.170.0050.00318.67
8.1.160.0030.00622.01
8.1.150.0050.00218.70
8.1.140.0040.00417.37
8.1.130.0000.00717.75
8.1.120.0000.00717.50
8.1.110.0000.00717.43
8.1.100.0070.00017.41
8.1.90.0080.00017.37
8.1.80.0000.00717.50
8.1.70.0000.00717.33
8.1.60.0000.00817.47
8.1.50.0000.00717.43
8.1.40.0040.00417.41
8.1.30.0000.00817.61
8.1.20.0040.00417.59
8.1.10.0070.00017.48
8.1.00.0070.00017.50
8.0.300.0040.00418.77
8.0.290.0040.00417.04
8.0.280.0000.00718.41
8.0.270.0070.00017.25
8.0.260.0000.00816.77
8.0.250.0000.00716.94
8.0.240.0000.00716.93
8.0.230.0000.00716.97
8.0.220.0070.00016.91
8.0.210.0050.00216.80
8.0.200.0000.00616.91
8.0.190.0040.00416.91
8.0.180.0000.00716.81
8.0.170.0000.00716.93
8.0.160.0040.00416.78
8.0.150.0000.00716.79
8.0.140.0000.00716.80
8.0.130.0050.00313.32
8.0.120.0030.00616.82
8.0.110.0080.00016.93
8.0.100.0050.00216.89
8.0.90.0050.00316.83
8.0.80.0070.01016.86
8.0.70.0000.00716.80
8.0.60.0040.00416.96
8.0.50.0030.00316.88
8.0.30.0110.01117.04
8.0.20.0070.01117.40
8.0.10.0040.00416.99
8.0.00.0130.00516.79
7.4.330.0000.00515.18
7.4.320.0000.00616.47
7.4.300.0060.00016.50
7.4.290.0000.00716.52
7.4.280.0070.00016.60
7.4.270.0040.00416.50
7.4.260.0030.00316.48
7.4.250.0070.00016.54
7.4.240.0020.00516.60
7.4.230.0000.00716.41
7.4.220.0150.00416.55
7.4.210.0050.01016.64
7.4.200.0050.00316.70
7.4.190.0030.00316.65
7.4.160.0040.01816.57
7.4.150.0060.01217.40
7.4.140.0090.01117.86
7.4.130.0110.00816.50
7.4.120.0100.00716.55
7.4.110.0070.01016.36
7.4.100.0170.00016.57
7.4.90.0100.00616.46
7.4.80.0000.01816.65
7.4.70.0120.00916.39
7.4.60.0030.01316.52
7.4.50.0060.00316.54
7.4.40.0040.01122.77
7.4.30.0040.01216.66
7.4.00.0070.01015.07
7.3.330.0030.00313.23
7.3.320.0020.00213.12
7.3.310.0030.00316.46
7.3.300.0030.00316.22
7.3.290.0030.01016.37
7.3.280.0110.00716.37
7.3.270.0000.01717.40
7.3.260.0090.01216.64
7.3.250.0170.00416.55
7.3.240.0120.00816.45
7.3.230.0090.00616.39
7.3.210.0070.01016.34
7.3.200.0090.01219.39
7.3.190.0120.00816.56
7.3.180.0050.01116.28
7.3.170.0140.00716.52
7.3.160.0100.00616.49
7.3.120.0070.00914.98
7.3.110.0060.01315.07
7.3.100.0080.00814.71
7.3.90.0090.00914.83
7.3.80.0110.00314.98
7.3.70.0030.01014.85
7.3.60.0030.00714.56
7.3.50.0060.00714.93
7.3.40.0050.00814.60
7.3.30.0100.00014.96
7.3.20.0090.00616.42
7.3.10.0090.00516.66
7.3.00.0050.00716.52
7.2.330.0090.00916.81
7.2.320.0060.01216.50
7.2.310.0140.00416.46
7.2.300.0100.00616.70
7.2.290.0170.00316.75
7.2.250.0070.01315.05
7.2.240.0130.00715.12
7.2.230.0070.01014.96
7.2.220.0000.01515.00
7.2.210.0080.00915.14
7.2.200.0030.00714.98
7.2.190.0080.00315.17
7.2.180.0150.00015.20
7.2.170.0040.00715.07
7.2.130.0040.00416.97
7.2.120.0040.00817.11
7.2.110.0030.00717.09
7.2.100.0030.01016.72
7.2.90.0030.00917.04
7.2.80.0090.00316.99
7.2.70.0100.00017.02
7.2.60.0130.00316.87
7.2.50.0070.00717.01
7.2.40.0070.00717.05
7.2.30.0100.00317.02
7.2.20.0090.00617.12
7.2.10.0040.00717.04
7.2.00.0020.00918.16
7.1.330.0040.01116.01
7.1.320.0070.00715.81
7.1.310.0040.01115.88
7.1.300.0040.00715.44
7.1.290.0120.00315.91
7.1.280.0000.01015.66
7.1.270.0030.00815.52
7.1.260.0070.00715.85
7.1.250.0070.00315.77
7.1.200.0070.00415.93
7.1.100.0040.00718.17
7.1.70.0000.01016.95
7.1.60.0100.01419.82
7.1.50.0090.00316.93
7.1.00.0000.07322.44
7.0.200.0110.00316.88
7.0.140.0000.07722.16
7.0.90.0530.05719.98
7.0.80.0430.05019.93
7.0.70.0500.04319.97
7.0.60.0300.08020.04
7.0.50.0700.08020.32
7.0.40.0070.08320.16
7.0.30.0030.05019.95
7.0.20.0130.07320.11
7.0.10.0100.04719.99
7.0.00.0000.09320.10
5.6.280.0000.07720.91
5.6.230.0130.04020.74
5.6.220.0030.06320.65
5.6.210.0100.04320.49
5.6.200.0070.08021.03
5.6.190.0070.05321.11
5.6.180.0100.07721.04
5.6.170.0030.09021.05
5.6.160.0170.07720.94
5.6.150.0130.07721.14
5.6.140.0170.07321.10
5.6.130.0070.08321.03
5.6.120.0230.05720.95
5.6.110.0070.08021.13
5.6.100.0070.08320.88
5.6.90.0170.06021.07
5.6.80.0100.03320.55
5.6.70.0070.08020.39
5.6.60.0030.08320.48
5.6.50.0170.06720.43
5.6.40.0130.05720.37
5.6.30.0100.06320.47
5.6.20.0030.07320.29
5.6.10.0000.08320.40
5.6.00.0130.07720.52
5.5.370.0100.04320.40
5.5.360.0100.03720.45
5.5.350.0230.05020.43
5.5.340.0070.07320.87
5.5.330.0070.04320.86
5.5.320.0070.05020.93
5.5.310.0130.07720.78
5.5.300.0130.07320.80
5.5.290.0070.08320.92
5.5.280.0070.08020.92
5.5.270.0130.04720.89
5.5.260.0170.08720.85
5.5.250.0100.08020.68
5.5.240.0070.08020.31
5.5.230.0030.05720.25
5.5.220.0100.07720.25
5.5.210.0100.08320.24
5.5.200.0030.06020.20
5.5.190.0230.06720.11
5.5.180.0100.08020.18
5.5.160.0070.05720.23
5.5.150.0070.07320.24
5.5.140.0100.07320.13
5.5.130.0070.08020.25
5.5.120.0070.06020.24
5.5.110.0100.04720.20
5.5.100.0100.07720.10
5.5.90.0070.07720.09
5.5.80.0000.04320.01
5.5.70.0130.07319.96
5.5.60.0000.08020.03
5.5.50.0000.08020.08
5.5.40.0130.07320.14
5.5.30.0170.04720.05
5.5.20.0170.06020.06
5.5.10.0130.06320.13
5.5.00.0130.07720.07
5.4.450.0100.08019.39
5.4.440.0130.07019.56
5.4.430.0030.07719.46
5.4.420.0070.05019.52
5.4.410.0100.07319.24
5.4.400.0070.08319.25
5.4.390.0030.04719.08
5.4.380.0130.06019.03
5.4.370.0030.05319.05
5.4.360.0030.04719.13
5.4.350.0000.08018.87
5.4.340.0070.07718.88
5.4.320.0030.04719.05
5.4.310.0000.05019.04
5.4.300.0170.06019.02
5.4.290.0070.07019.02
5.4.280.0130.07319.15
5.4.270.0200.03719.09
5.4.260.0070.07719.15
5.4.250.0100.07319.18
5.4.240.0130.07719.08
5.4.230.0030.08018.90
5.4.220.0000.08318.84
5.4.210.0100.07319.12
5.4.200.0100.04719.04
5.4.190.0070.05018.88
5.4.180.0100.07319.04
5.4.170.0100.07319.02
5.4.160.0030.07319.10
5.4.150.0070.08018.92
5.4.140.0170.04716.39
5.4.130.0100.07316.49
5.4.120.0130.04716.41
5.4.110.0200.06316.48
5.4.100.0070.05016.29
5.4.90.0030.03716.48
5.4.80.0000.05016.30
5.4.70.0070.06316.46
5.4.60.0100.06316.47
5.4.50.0170.06716.41
5.4.40.0100.06716.46
5.4.30.0130.07316.52
5.4.20.0070.05716.49
5.4.10.0130.06316.38
5.4.00.0000.07315.79
5.3.290.0100.06314.63
5.3.280.0100.04014.65
5.3.270.0100.04314.74
5.3.260.0070.06014.63
5.3.250.0070.07314.55
5.3.240.0070.04314.66
5.3.230.0100.07314.54
5.3.220.0030.06014.48
5.3.210.0100.07714.62
5.3.200.0070.07714.64
5.3.190.0070.07714.50
5.3.180.0030.05714.62
5.3.170.0070.07314.57
5.3.160.0030.06714.63
5.3.150.0100.06714.57
5.3.140.0130.07014.48
5.3.130.0100.06714.52
5.3.120.0070.05014.55
5.3.110.0030.08014.48
5.3.100.0100.07314.16
5.3.90.0100.06314.00
5.3.80.0030.05014.05
5.3.70.0030.07713.95
5.3.60.0100.04714.03
5.3.50.0200.06013.96
5.3.40.0070.06014.05
5.3.30.0130.06313.96
5.3.20.0200.06713.82
5.3.10.0130.05313.79
5.3.00.0030.06313.68
5.2.170.0100.06013.68
5.2.160.0070.05013.68
5.2.150.0030.03713.68
5.2.140.0000.04013.68
5.2.130.0100.05713.68
5.2.120.0170.05013.68
5.2.110.0070.04013.68
5.2.100.0000.03313.68
5.2.90.0070.05713.68
5.2.80.0070.06013.68
5.2.70.0030.06713.68
5.2.60.0100.05713.68
5.2.50.0100.06013.68
5.2.40.0130.04713.68
5.2.30.0000.06713.68
5.2.20.0070.04013.68
5.2.10.0070.06013.68
5.2.00.0070.06013.68
5.1.60.0070.05013.68
5.1.50.0070.05013.68
5.1.40.0030.05713.68
5.1.30.0070.03713.68
5.1.20.0100.03013.68
5.1.10.0070.05713.68
5.1.00.0030.05313.68
5.0.50.0030.04713.68
5.0.40.0030.05313.68
5.0.30.0000.06313.68
5.0.20.0070.04013.68
5.0.10.0030.04313.68
5.0.00.0070.05313.68
4.4.90.0030.02713.68
4.4.80.0030.03313.68
4.4.70.0000.04013.68
4.4.60.0000.03713.68
4.4.50.0000.03713.68
4.4.40.0070.05013.68
4.4.30.0000.03713.68
4.4.20.0000.03713.68
4.4.10.0070.02313.68
4.4.00.0070.05013.68
4.3.110.0030.03013.68
4.3.100.0030.03313.68
4.3.90.0000.03013.68
4.3.80.0000.03713.68
4.3.70.0030.02013.68
4.3.60.0100.03013.68
4.3.50.0100.02013.68
4.3.40.0000.05313.68
4.3.30.0000.03313.68
4.3.20.0000.02713.68
4.3.10.0000.02013.68
4.3.00.0030.02013.68

preferences:
40.82 ms | 400 KiB | 5 Q