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 = "string_1ABCDEFGHstring2 some string here string_1IJKLMNOPQRSTstring2 some string here string_1UVWstring2XYZ"; $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.0140.00716.38
8.3.50.0100.00922.04
8.3.40.0120.00318.85
8.3.30.0100.00319.14
8.3.20.0000.00720.20
8.3.10.0040.00423.42
8.3.00.0080.00019.26
8.2.180.0100.01025.92
8.2.170.0180.00419.04
8.2.160.0080.01222.96
8.2.150.0070.00725.66
8.2.140.0040.00424.66
8.2.130.0120.00326.16
8.2.120.0080.00022.25
8.2.110.0060.00322.44
8.2.100.0090.00317.72
8.2.90.0000.00819.35
8.2.80.0030.00517.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0100.00018.14
8.2.30.0050.00218.01
8.2.20.0040.00417.66
8.2.10.0000.00718.00
8.2.00.0000.00817.65
8.1.280.0120.00325.92
8.1.270.0040.00422.01
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00023.79
8.1.230.0000.01019.10
8.1.220.0030.00617.77
8.1.210.0060.00318.77
8.1.200.0070.00317.25
8.1.190.0100.00017.35
8.1.180.0000.00818.10
8.1.170.0090.00018.46
8.1.160.0000.00822.02
8.1.150.0040.00418.64
8.1.140.0000.00717.50
8.1.130.0070.00017.80
8.1.120.0000.00717.51
8.1.110.0040.00417.36
8.1.100.0000.00717.49
8.1.90.0050.00317.38
8.1.80.0050.00317.45
8.1.70.0070.00017.31
8.1.60.0000.00817.59
8.1.50.0030.00517.39
8.1.40.0050.00317.52
8.1.30.0030.00517.56
8.1.20.0070.00017.55
8.1.10.0000.00817.60
8.1.00.0050.00217.39
8.0.300.0040.00420.79
8.0.290.0060.00317.18
8.0.280.0030.00518.34
8.0.270.0030.00317.27
8.0.260.0030.00317.27
8.0.250.0000.00716.97
8.0.240.0090.00316.97
8.0.230.0030.00317.02
8.0.220.0030.00316.86
8.0.210.0000.00816.91
8.0.200.0040.00416.98
8.0.190.0000.00716.84
8.0.180.0030.00516.85
8.0.170.0000.00816.91
8.0.160.0070.00016.80
8.0.150.0050.00216.76
8.0.140.0030.00516.77
8.0.130.0080.00013.35
8.0.120.0000.00816.74
8.0.110.0040.00416.80
8.0.100.0000.00716.92
8.0.90.0030.00616.78
8.0.80.0060.00916.84
8.0.70.0070.00016.74
8.0.60.0030.00516.84
8.0.50.0000.00716.76
8.0.30.0140.00916.98
8.0.20.0090.01317.40
8.0.10.0040.00416.98
8.0.00.0090.01016.65
7.4.330.0050.00015.04
7.4.320.0040.00416.60
7.4.300.0070.00016.46
7.4.290.0030.00316.58
7.4.280.0000.00816.50
7.4.270.0000.00716.50
7.4.260.0000.00716.49
7.4.250.0050.00316.46
7.4.240.0030.00416.54
7.4.230.0030.00316.71
7.4.220.0070.01116.52
7.4.210.0070.00916.56
7.4.200.0070.00016.71
7.4.190.0000.00716.49
7.4.160.0130.00316.38
7.4.150.0100.00717.40
7.4.140.0110.00717.86
7.4.130.0090.00916.43
7.4.120.0090.00916.41
7.4.110.0030.01316.42
7.4.100.0030.01816.67
7.4.90.0060.01216.52
7.4.80.0120.00919.39
7.4.70.0090.00816.39
7.4.60.0100.00716.50
7.4.50.0000.00816.50
7.4.40.0120.00416.51
7.4.30.0080.00816.32
7.4.00.0070.00715.00
7.3.330.0000.00613.38
7.3.320.0050.00013.37
7.3.310.0030.00316.34
7.3.300.0040.00416.19
7.3.290.0060.00916.36
7.3.280.0060.00916.35
7.3.270.0070.01017.40
7.3.260.0130.01016.31
7.3.250.0100.00816.55
7.3.240.0090.00916.60
7.3.230.0030.01416.52
7.3.210.0090.00616.61
7.3.200.0150.01119.39
7.3.190.0170.00416.39
7.3.180.0080.00816.43
7.3.170.0110.00716.59
7.3.160.0060.01216.36
7.3.120.0070.01015.14
7.3.10.0040.01116.74
7.3.00.0070.00616.67
7.2.330.0130.00316.53
7.2.320.0090.01316.69
7.2.310.0090.01216.51
7.2.300.0090.00716.68
7.2.290.0100.00716.70
7.2.130.0030.00916.74
7.2.120.0050.00716.88
7.2.110.0050.00916.66
7.2.100.0040.00916.85
7.2.90.0090.00516.85
7.2.80.0090.00716.79
7.2.70.0060.00616.80
7.2.60.0030.00816.90
7.2.50.0050.00817.00
7.2.40.0060.00616.93
7.2.30.0040.01017.01
7.2.20.0090.00516.93
7.2.10.0110.00316.78
7.2.00.0030.01017.42
7.1.250.0040.00815.94
7.1.230.0040.00815.99
7.1.220.0060.00615.80
7.1.210.0000.01415.85
7.1.200.0090.00315.65
7.1.190.0070.00715.86
7.1.180.0030.00716.04
7.1.170.0030.00915.93
7.1.160.0070.00715.62
7.1.150.0030.01015.98
7.1.140.0120.00015.76
7.1.130.0030.01015.55
7.1.120.0030.00715.59
7.1.110.0030.01015.76
7.1.100.0040.00717.15
7.1.90.0030.00715.94
7.1.80.0040.00815.75
7.1.70.0040.00816.44
7.1.60.0100.01017.68
7.1.50.0130.00816.45
7.1.40.0030.01315.72
7.1.30.0000.01716.03
7.1.20.0100.00715.87
7.1.10.0060.00315.56
7.1.00.0050.04219.05
7.0.310.0000.00915.44
7.0.300.0000.01515.12
7.0.290.0030.00915.46
7.0.280.0000.00815.29
7.0.270.0030.00615.40
7.0.260.0120.00315.57
7.0.250.0040.00415.11
7.0.240.0060.00615.38
7.0.230.0130.00015.52
7.0.220.0000.01315.38
7.0.210.0080.00315.37
7.0.200.0000.00816.11
7.0.190.0030.01015.54
7.0.180.0060.00615.13
7.0.170.0040.01115.44
7.0.160.0100.00315.38
7.0.150.0040.00715.15
7.0.140.0050.03918.62
7.0.130.0070.00715.51
7.0.120.0060.01015.27
7.0.110.0050.00515.46
7.0.100.0030.01015.57
7.0.90.0060.00615.30
7.0.80.0060.00615.32
7.0.70.0050.03818.53
7.0.60.0070.04018.42
7.0.50.0040.02618.76
7.0.40.0030.03716.83
7.0.30.0030.03316.80
7.0.20.0050.04416.83
7.0.10.0030.03416.84
7.0.00.0060.03916.88
5.6.380.0130.00314.50
5.6.370.0060.00914.78
5.6.360.0120.00014.69
5.6.350.0100.00314.38
5.6.340.0130.00014.63
5.6.330.0070.00714.44
5.6.320.0110.00414.15
5.6.310.0130.00314.89
5.6.300.0030.00714.47
5.6.290.0000.01414.68
5.6.280.0030.05017.71
5.6.270.0070.00714.48
5.6.260.0000.01514.72
5.6.250.0030.00714.13
5.6.240.0070.00314.39
5.6.230.0000.01114.57
5.6.220.0050.03817.42
5.6.210.0080.04217.48
5.6.200.0060.04217.71
5.6.190.0070.04317.80
5.6.180.0050.04217.53
5.6.170.0070.03817.76
5.6.160.0070.04217.92
5.6.150.0080.04217.83
5.6.140.0000.03917.70
5.6.130.0050.04517.64
5.6.120.0050.04217.81
5.6.110.0080.03017.74
5.6.100.0050.03517.76
5.6.90.0050.04717.64
5.6.80.0030.03117.50
5.6.70.0050.04217.46
5.6.60.0060.03717.38
5.6.50.0060.04217.35
5.6.40.0020.04417.51
5.6.30.0070.04017.41
5.6.20.0060.04417.51
5.6.10.0050.02317.43
5.6.00.0020.05317.28
5.5.380.0000.01211.09
5.5.370.0000.00811.53
5.5.360.0020.03715.73
5.5.350.0010.04415.68
5.5.340.0000.04615.95
5.5.330.0020.04416.08
5.5.320.0080.03515.99
5.5.310.0070.03716.10
5.5.300.0000.04916.17
5.5.290.0040.04516.11
5.5.280.0040.04916.00
5.5.270.0070.03716.01
5.5.260.0070.03715.99
5.5.250.0020.04715.98
5.5.240.0030.02615.78
5.5.230.0050.02715.72
5.5.220.0010.04115.61
5.5.210.0000.04315.75
5.5.200.0030.03815.72
5.5.190.0030.04015.69
5.5.180.0030.03915.75
5.5.170.0000.00814.38
5.5.160.0090.03515.78
5.5.150.0040.03515.72
5.5.140.0050.04115.71
5.5.130.0040.04015.77
5.5.120.0030.04215.57
5.5.110.0020.03615.75
5.5.100.0080.03715.53
5.5.90.0060.03815.71
5.5.80.0070.04015.56
5.5.70.0020.04115.71
5.5.60.0070.02515.71
5.5.50.0050.03115.49
5.5.40.0040.04415.43
5.5.30.0030.03815.44
5.5.20.0070.03515.55
5.5.10.0050.04215.61
5.5.00.0040.03615.53
5.4.450.0060.04015.10
5.4.440.0080.03715.41
5.4.430.0050.04215.16
5.4.420.0030.04315.27
5.4.410.0040.03915.26
5.4.400.0020.04215.23
5.4.390.0050.03815.14
5.4.380.0030.03915.06
5.4.370.0080.03815.16
5.4.360.0080.03815.12
5.4.350.0070.03715.01
5.4.340.0020.03415.00
5.4.330.0100.00311.07
5.4.320.0060.03615.20
5.4.310.0020.04315.04
5.4.300.0030.03315.23
5.4.290.0090.03415.05
5.4.280.0020.04414.93
5.4.270.0030.02815.08
5.4.260.0080.03515.14
5.4.250.0020.04515.02
5.4.240.0050.03815.10
5.4.230.0050.03614.97
5.4.220.0020.04414.75
5.4.210.0020.03115.07
5.4.200.0090.03615.20
5.4.190.0080.03614.91
5.4.180.0030.04215.10
5.4.170.0050.03815.10
5.4.160.0110.03115.17
5.4.150.0020.04415.11
5.4.140.0030.03813.88
5.4.130.0050.03713.74
5.4.120.0090.03113.83
5.4.110.0090.03413.88
5.4.100.0000.03513.79
5.4.90.0030.03013.84
5.4.80.0050.04013.57
5.4.70.0030.04013.70
5.4.60.0020.04013.79
5.4.50.0030.03113.68
5.4.40.0050.02413.87
5.4.30.0050.04113.82
5.4.20.0020.02913.75
5.4.10.0030.04113.61
5.4.00.0070.03513.48
5.3.290.0070.02812.60
5.3.280.0030.03212.61
5.3.270.0040.04212.58
5.3.260.0030.03812.63
5.3.250.0020.04012.61
5.3.240.0030.03812.57
5.3.230.0030.02612.64
5.3.220.0030.03512.60
5.3.210.0030.04212.56
5.3.200.0050.02912.64
5.3.190.0010.03812.58
5.3.180.0030.04012.71
5.3.170.0070.03512.67
5.3.160.0050.03512.60
5.3.150.0020.04212.61
5.3.140.0020.03412.64
5.3.130.0030.03612.62
5.3.120.0020.03512.66
5.3.110.0010.04612.65
5.3.100.0040.03512.32
5.3.90.0020.04112.38
5.3.80.0030.03712.36
5.3.70.0020.02812.32
5.3.60.0020.04412.29
5.3.50.0020.04012.23
5.3.40.0050.02512.23
5.3.30.0060.03212.29
5.3.20.0050.03512.18
5.3.10.0030.03612.19
5.3.00.0050.03712.14
5.2.170.0060.03010.92
5.2.160.0030.03010.84
5.2.150.0030.02710.84
5.2.140.0050.03210.93
5.2.130.0030.03110.90
5.2.120.0030.03010.90
5.2.110.0000.03810.86
5.2.100.0030.03010.91
5.2.90.0030.03110.79
5.2.80.0040.02110.82
5.2.70.0000.03510.91
5.2.60.0010.03310.85
5.2.50.0030.03310.75
5.2.40.0050.03010.85
5.2.30.0020.03110.85
5.2.20.0030.02310.81
5.2.10.0040.03010.75
5.2.00.0060.02810.73
5.1.60.0040.02210.25
5.1.50.0030.02810.35
5.1.40.0050.02510.28
5.1.30.0020.03210.54
5.1.20.0040.02010.51
5.1.10.0030.03110.26
5.1.00.0020.02710.36
5.0.50.0030.0209.60
5.0.40.0010.0159.60
5.0.30.0030.0239.60
5.0.20.0000.0239.60
5.0.10.0030.0219.60
5.0.00.0000.0379.60
4.4.90.0050.0139.60
4.4.80.0030.0179.60
4.4.70.0030.0109.60
4.4.60.0000.0189.60
4.4.50.0020.0209.60
4.4.40.0030.0279.60
4.4.30.0000.0199.60
4.4.20.0000.0199.60
4.4.10.0020.0209.60
4.4.00.0010.0299.60
4.3.110.0020.0199.60
4.3.100.0030.0139.60
4.3.90.0000.0119.60
4.3.80.0030.0209.60
4.3.70.0050.0109.60
4.3.60.0030.0159.60
4.3.50.0000.0179.60
4.3.40.0030.0229.60
4.3.30.0020.0229.60
4.3.20.0020.0189.60
4.3.10.0010.0209.60
4.3.00.0000.0189.60

preferences:
54.41 ms | 401 KiB | 5 Q