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)); //echo $the_string; $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)); echo $a_start_match."\n"; //echo substr($a_start_match, -strlen($ends_with))." against ".$ends_with."\n"; if(substr($a_start_match, -strlen($ends_with)) === $ends_with) { echo $a_start_match."\n"; $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_1UVWstring2XYZ"; $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.0070.01316.75
8.3.50.0080.00721.94
8.3.40.0120.00618.75
8.3.30.0100.00319.09
8.3.20.0000.00820.29
8.3.10.0040.00423.48
8.3.00.0060.00919.25
8.2.180.0120.00317.93
8.2.170.0100.00322.96
8.2.160.0000.01520.30
8.2.150.0110.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00022.27
8.2.110.0080.00322.25
8.2.100.0070.00317.72
8.2.90.0000.00919.21
8.2.80.0040.00418.03
8.2.70.0060.00317.50
8.2.60.0040.00417.68
8.2.50.0030.00518.07
8.2.40.0060.00318.09
8.2.30.0000.00818.11
8.2.20.0040.00417.55
8.2.10.0070.00018.00
8.2.00.0000.00917.75
8.1.280.0120.00325.92
8.1.270.0080.00022.11
8.1.260.0000.00826.35
8.1.250.0090.00028.09
8.1.240.0150.00622.19
8.1.230.0110.00520.15
8.1.220.0090.00017.74
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0000.00817.43
8.1.180.0050.00318.10
8.1.170.0110.00018.46
8.1.160.0080.00022.00
8.1.150.0000.00718.58
8.1.140.0070.00017.33
8.1.130.0000.00717.75
8.1.120.0030.00317.41
8.1.110.0040.00417.51
8.1.100.0000.00717.38
8.1.90.0070.00017.48
8.1.80.0050.00217.33
8.1.70.0030.00317.31
8.1.60.0080.00017.42
8.1.50.0030.00517.43
8.1.40.0040.00417.55
8.1.30.0000.00817.52
8.1.20.0000.00717.65
8.1.10.0070.00017.55
8.1.00.0040.00417.46
8.0.300.0040.00418.77
8.0.290.0000.00817.16
8.0.280.0040.00418.39
8.0.270.0030.00317.26
8.0.260.0000.00716.74
8.0.250.0030.00316.97
8.0.240.0050.00216.85
8.0.230.0000.00716.84
8.0.220.0070.00016.79
8.0.210.0000.00716.88
8.0.200.0000.00816.89
8.0.190.0030.00616.97
8.0.180.0000.00716.93
8.0.170.0000.00716.80
8.0.160.0040.00417.00
8.0.150.0000.00716.72
8.0.140.0030.00516.79
8.0.130.0030.00313.32
8.0.120.0040.00416.86
8.0.110.0050.00216.95
8.0.100.0000.00716.85
8.0.90.0040.00416.96
8.0.80.0040.01116.78
8.0.70.0050.00316.87
8.0.60.0000.00816.89
8.0.50.0000.00817.01
8.0.30.0050.01516.99
8.0.20.0100.01117.40
8.0.10.0030.00516.96
8.0.00.0110.00816.72
7.4.330.0000.00615.02
7.4.320.0030.00316.57
7.4.300.0070.00016.52
7.4.290.0000.00716.58
7.4.280.0000.00816.51
7.4.270.0050.00316.60
7.4.260.0030.00316.50
7.4.250.0040.00416.55
7.4.240.0010.00616.47
7.4.230.0030.00316.41
7.4.220.0030.01716.67
7.4.210.0050.01416.55
7.4.200.0070.00016.61
7.4.190.0090.00016.64
7.4.160.0080.00816.52
7.4.150.0140.01017.40
7.4.140.0110.00717.86
7.4.130.0080.00816.54
7.4.120.0060.01116.60
7.4.110.0030.01416.40
7.4.100.0090.00916.40
7.4.90.0090.00616.57
7.4.80.0090.00919.39
7.4.70.0070.01016.63
7.4.60.0140.00316.52
7.4.50.0000.00616.59
7.4.40.0040.01522.77
7.4.30.0050.01116.37
7.4.00.0050.01314.88
7.3.330.0030.00313.41
7.3.320.0050.00013.31
7.3.310.0070.00016.23
7.3.300.0000.00716.23
7.3.290.0000.01516.50
7.3.280.0090.00816.38
7.3.270.0090.00917.40
7.3.260.0120.00616.27
7.3.250.0110.00816.34
7.3.240.0080.01116.70
7.3.230.0130.00416.61
7.3.210.0030.01416.30
7.3.200.0130.00319.39
7.3.190.0060.00916.29
7.3.180.0100.00616.34
7.3.170.0120.00916.52
7.3.160.0000.01616.59
7.3.120.0080.00814.70
7.3.110.0000.01814.52
7.3.100.0000.01415.14
7.3.90.0000.01114.92
7.3.80.0030.01114.84
7.3.70.0030.01014.87
7.3.60.0070.01014.89
7.3.50.0090.00615.04
7.3.40.0080.00414.92
7.3.30.0000.01114.99
7.3.20.0070.00716.75
7.3.10.0070.00716.64
7.3.00.0050.00816.59
7.2.330.0060.01216.45
7.2.320.0130.00316.55
7.2.310.0050.01116.80
7.2.300.0030.01216.56
7.2.290.0070.01416.80
7.2.250.0040.01115.05
7.2.240.0070.01014.93
7.2.230.0060.01215.24
7.2.220.0040.00814.81
7.2.210.0070.01115.15
7.2.200.0070.00315.19
7.2.190.0150.00315.12
7.2.180.0070.01015.10
7.2.170.0060.00314.98
7.2.130.0080.00716.95
7.2.120.0100.00317.13
7.2.110.0000.01416.89
7.2.100.0000.01416.99
7.2.90.0030.01316.89
7.2.80.0000.01216.88
7.2.70.0120.00316.98
7.2.60.0030.01216.87
7.2.50.0040.01116.81
7.2.40.0000.01216.72
7.2.30.0060.01016.96
7.2.20.0000.01316.81
7.2.10.0130.00316.81
7.2.00.0080.00618.13
7.1.330.0070.00715.71
7.1.320.0040.00815.82
7.1.310.0030.01215.87
7.1.300.0090.00615.66
7.1.290.0000.00915.77
7.1.280.0060.00915.68
7.1.270.0070.00715.67
7.1.260.0100.00316.04
7.1.250.0070.00715.54
7.1.240.0110.00415.78
7.1.230.0110.00315.93
7.1.220.0120.00015.75
7.1.210.0030.01015.63
7.1.200.0080.00616.02
7.1.190.0030.00615.71
7.1.180.0030.01015.79
7.1.170.0100.00015.82
7.1.160.0000.01115.85
7.1.150.0100.00315.74
7.1.140.0070.00315.45
7.1.130.0070.00715.55
7.1.120.0030.01015.65
7.1.110.0080.00515.76
7.1.100.0040.01317.12
7.1.90.0060.00915.99
7.1.80.0040.00415.87
7.1.70.0050.00516.55
7.1.60.0090.00817.57
7.1.50.0060.00616.46
7.1.40.0030.01015.84
7.1.30.0060.01015.86
7.1.20.0000.01615.75
7.1.10.0060.00315.60
7.1.00.0040.04419.05
7.0.330.0030.01315.51
7.0.320.0000.01115.36
7.0.310.0060.00615.40
7.0.300.0030.01215.27
7.0.290.0000.00915.36
7.0.280.0080.00015.34
7.0.270.0000.00915.23
7.0.260.0000.00914.97
7.0.250.0000.01215.09
7.0.240.0030.01015.32
7.0.230.0000.01315.30
7.0.220.0030.01015.19
7.0.210.0040.01215.46
7.0.200.0020.01116.06
7.0.190.0060.00915.29
7.0.180.0030.01015.25
7.0.170.0000.00915.31
7.0.160.0080.00415.42
7.0.150.0090.00015.40
7.0.140.0020.04318.68
7.0.130.0070.00415.21
7.0.120.0150.00015.24
7.0.110.0000.01215.31
7.0.100.0040.04017.66
7.0.90.0170.03817.54
7.0.80.0020.04617.73
7.0.70.0180.04317.70
7.0.60.0120.02517.68
7.0.50.0030.02217.87
7.0.40.0050.04716.57
7.0.30.0100.02216.63
7.0.20.0020.03216.76
7.0.10.0100.02516.84
7.0.00.0120.02316.61
5.6.380.0000.01014.46
5.6.370.0040.00713.97
5.6.360.0000.01714.32
5.6.350.0030.00614.44
5.6.340.0030.01014.16
5.6.330.0100.00314.48
5.6.320.0040.00414.63
5.6.310.0070.00714.55
5.6.300.0100.00314.09
5.6.290.0100.00313.86
5.6.280.0040.04017.86
5.6.270.0070.00314.32
5.6.260.0000.01214.00
5.6.250.0050.03217.48
5.6.240.0100.04517.54
5.6.230.0080.04317.42
5.6.220.0080.04317.40
5.6.210.0040.03417.35
5.6.200.0050.05417.73
5.6.190.0060.03717.54
5.6.180.0050.03917.67
5.6.170.0090.04017.44
5.6.160.0050.04217.63
5.6.150.0020.03317.68
5.6.140.0060.02317.67
5.6.130.0050.02517.72
5.6.120.0040.02917.54
5.6.110.0060.02517.83
5.6.100.0070.02317.64
5.6.90.0050.02317.70
5.6.80.0030.02017.26
5.6.70.0070.01717.23
5.6.60.0030.02317.38
5.6.50.0050.02017.35
5.6.40.0000.02517.40
5.6.30.0030.02517.33
5.6.20.0020.02217.18
5.6.10.0030.02317.41
5.6.00.0030.02117.32
5.5.380.0050.04215.73
5.5.370.0160.03015.75
5.5.360.0040.02315.61
5.5.350.0060.03615.70
5.5.340.0100.04015.95
5.5.330.0120.03915.91
5.5.320.0050.02516.13
5.5.310.0070.02715.98
5.5.300.0050.02615.90
5.5.290.0110.02115.84
5.5.280.0030.02215.85
5.5.270.0050.02316.07
5.5.260.0050.02015.88
5.5.250.0060.02115.82
5.5.240.0060.01615.74
5.5.230.0040.02115.66
5.5.220.0030.02015.65
5.5.210.0120.01415.59
5.5.200.0000.02115.62
5.5.190.0020.03415.66
5.5.180.0050.01815.57
5.5.170.0040.00811.25
5.5.160.0030.02415.64
5.5.150.0000.02515.64
5.5.140.0020.02115.43
5.5.130.0020.02115.59
5.5.120.0040.02015.63
5.5.110.0080.01615.65
5.5.100.0050.02115.55
5.5.90.0000.02215.56
5.5.80.0080.02015.56
5.5.70.0110.01815.60
5.5.60.0050.02015.66
5.5.50.0000.02715.69
5.5.40.0080.02015.54
5.5.30.0070.02015.67
5.5.20.0000.02715.51
5.5.10.0040.02015.52
5.5.00.0020.02215.45
5.4.450.0050.01915.07
5.4.440.0030.02415.31
5.4.430.0100.01815.32
5.4.420.0040.02415.26
5.4.410.0030.01915.29
5.4.400.0040.01815.05
5.4.390.0060.01814.96
5.4.380.0050.01814.87
5.4.370.0060.01615.08
5.4.360.0020.02314.98
5.4.350.0020.02115.15
5.4.340.0050.02214.82
5.4.330.0050.00510.81
5.4.320.0050.02215.23
5.4.310.0090.01414.95
5.4.300.0030.01815.07
5.4.290.0040.02015.03
5.4.280.0020.02015.04
5.4.270.0070.02215.09
5.4.260.0040.01915.15
5.4.250.0030.01915.13
5.4.240.0020.02215.05
5.4.230.0000.02115.11
5.4.220.0040.01714.91
5.4.210.0050.02014.93
5.4.200.0050.01815.08
5.4.190.0070.02315.16
5.4.180.0030.02014.97
5.4.170.0020.02015.01
5.4.160.0000.02115.05
5.4.150.0030.02015.04
5.4.140.0030.02013.62
5.4.130.0050.01813.70
5.4.120.0050.03613.61
5.4.110.0020.02313.79
5.4.100.0020.02713.60
5.4.90.0070.02013.67
5.4.80.0110.02313.72
5.4.70.0090.02813.62
5.4.60.0070.03613.68
5.4.50.0060.03413.75
5.4.40.0050.01813.87
5.4.30.0100.02213.63
5.4.20.0030.02813.74
5.4.10.0040.04013.73
5.4.00.0050.04013.53
5.3.290.0030.02112.77
5.3.280.0030.02012.47
5.3.270.0030.01812.59
5.3.260.0050.01812.60
5.3.250.0050.01712.54
5.3.240.0020.02012.62
5.3.230.0060.03812.61
5.3.220.0060.03512.46
5.3.210.0050.04212.52
5.3.200.0020.02012.56
5.3.190.0030.04112.57
5.3.180.0010.02812.67
5.3.170.0000.04212.64
5.3.160.0090.01912.68
5.3.150.0070.02512.67
5.3.140.0040.02612.59
5.3.130.0100.02012.50
5.3.120.0110.03612.54
5.3.110.0060.02012.54
5.3.100.0020.04212.36
5.3.90.0030.03612.39
5.3.80.0140.03012.28
5.3.70.0080.02412.15
5.3.60.0030.02512.42
5.3.50.0040.02312.29
5.3.40.0080.03712.20
5.3.30.0070.03412.17
5.3.20.0050.04212.19
5.3.10.0030.03012.04
5.3.00.0080.03511.97
5.2.170.0030.02410.39
5.2.160.0070.03210.44
5.2.150.0050.02110.42
5.2.140.0100.02410.29
5.2.130.0030.03210.33
5.2.120.0020.02210.39
5.2.110.0050.03210.38
5.2.100.0020.01810.23
5.2.90.0000.02110.27
5.2.80.0020.02310.20
5.2.70.0050.02810.20
5.2.60.0040.01410.22
5.2.50.0040.02910.29
5.2.40.0060.03110.36
5.2.30.0050.03310.24
5.2.20.0020.02910.28
5.2.10.0050.02510.14
5.2.00.0070.02810.13
5.1.60.0010.0259.73
5.1.50.0050.0149.64
5.1.40.0040.0159.61
5.1.30.0050.0309.84
5.1.20.0010.0289.89
5.1.10.0050.0279.68
5.1.00.0060.0269.80
5.0.50.0000.0229.48
5.0.40.0060.0189.48
5.0.30.0000.0199.48
5.0.20.0050.0239.48
5.0.10.0030.0129.48
5.0.00.0050.0229.48
4.4.90.0030.0179.48
4.4.80.0020.0159.48
4.4.70.0020.0209.48
4.4.60.0020.0109.48
4.4.50.0030.0179.48
4.4.40.0000.0309.48
4.4.30.0030.0189.48
4.4.20.0030.0179.48
4.4.10.0010.0229.48
4.4.00.0020.0179.48
4.3.110.0020.0129.48
4.3.100.0050.0179.48
4.3.90.0050.0089.48
4.3.80.0020.0259.48
4.3.70.0020.0209.48
4.3.60.0020.0159.48
4.3.50.0030.0109.48
4.3.40.0020.0209.48
4.3.30.0040.0089.48
4.3.20.0030.0139.48
4.3.10.0000.0229.48
4.3.00.0000.0179.48

preferences:
35.67 ms | 401 KiB | 5 Q