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 = "some string here 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.0110.00718.18
8.3.50.0140.00416.48
8.3.40.0120.00318.72
8.3.30.0120.00318.60
8.3.20.0090.00018.57
8.3.10.0080.00018.73
8.3.00.0040.00419.26
8.2.180.0150.00016.75
8.2.170.0170.00322.96
8.2.160.0040.01218.97
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00820.63
8.2.110.0150.00322.01
8.2.100.0040.00717.91
8.2.90.0080.00019.21
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0070.00017.93
8.2.50.0000.00917.93
8.2.40.0060.00319.47
8.2.30.0030.00717.63
8.2.20.0000.01017.64
8.2.10.0000.00717.75
8.2.00.0000.01017.80
8.1.280.0060.01225.92
8.1.270.0050.00223.99
8.1.260.0000.00926.35
8.1.250.0070.00028.09
8.1.240.0060.00320.67
8.1.230.0040.00721.04
8.1.220.0000.00917.74
8.1.210.0060.00318.77
8.1.200.0040.00417.35
8.1.190.0050.00317.22
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0040.00419.03
8.1.150.0040.00418.69
8.1.140.0000.00817.34
8.1.130.0070.00017.50
8.1.120.0040.00417.46
8.1.110.0040.00417.46
8.1.100.0070.00017.32
8.1.90.0000.00717.36
8.1.80.0000.00717.45
8.1.70.0030.00317.44
8.1.60.0050.00317.50
8.1.50.0060.00317.48
8.1.40.0030.00617.53
8.1.30.0030.00617.68
8.1.20.0050.00217.67
8.1.10.0000.00817.49
8.1.00.0040.00417.42
8.0.300.0030.00518.77
8.0.290.0050.00316.75
8.0.280.0000.00718.50
8.0.270.0000.00817.25
8.0.260.0030.00316.82
8.0.250.0000.00716.82
8.0.240.0000.00816.93
8.0.230.0000.00616.98
8.0.220.0040.00416.92
8.0.210.0030.00316.75
8.0.200.0030.00316.93
8.0.190.0030.00516.79
8.0.180.0030.00716.95
8.0.170.0000.00916.84
8.0.160.0070.00017.01
8.0.150.0040.00416.88
8.0.140.0000.00816.84
8.0.130.0000.00613.30
8.0.120.0000.00816.73
8.0.110.0000.00716.80
8.0.100.0040.00416.73
8.0.90.0040.00417.01
8.0.80.0040.01116.86
8.0.70.0000.00716.74
8.0.60.0060.00316.77
8.0.50.0000.00916.81
8.0.30.0060.01316.88
8.0.20.0140.00517.00
8.0.10.0000.00817.07
8.0.00.0140.00716.82
7.4.330.0020.00212.96
7.4.320.0000.00616.50
7.4.300.0000.00616.52
7.4.290.0000.00716.53
7.4.280.0060.00316.57
7.4.270.0040.00416.62
7.4.260.0050.00213.24
7.4.250.0040.00416.39
7.4.240.0030.00316.50
7.4.230.0000.01116.39
7.4.220.0210.00316.48
7.4.210.0070.00716.64
7.4.200.0000.00816.69
7.4.190.0040.00416.64
7.4.160.0060.01316.38
7.4.150.0110.00616.48
7.4.140.0160.00316.48
7.4.130.0140.00316.56
7.4.120.0070.01016.59
7.4.110.0130.01016.48
7.4.100.0100.00716.47
7.4.90.0120.00616.62
7.4.80.0120.00619.39
7.4.70.0140.00616.54
7.4.60.0080.00816.46
7.4.50.0060.00316.50
7.4.40.0060.00916.42
7.4.30.0130.01216.55
7.4.00.0020.01315.14
7.3.330.0000.00813.32
7.3.320.0030.00313.31
7.3.310.0070.00016.25
7.3.300.0030.00316.36
7.3.290.0100.00716.35
7.3.280.0100.00916.35
7.3.270.0030.01316.61
7.3.260.0030.01316.61
7.3.250.0100.01116.46
7.3.240.0090.00916.61
7.3.230.0070.01016.41
7.3.210.0110.00616.48
7.3.200.0100.00716.29
7.3.190.0090.00616.49
7.3.180.0040.01216.63
7.3.170.0130.00316.51
7.3.160.0110.01216.57
7.3.120.0080.00714.97
7.3.110.0030.01315.08
7.3.100.0030.01214.99
7.3.90.0070.01014.50
7.3.80.0070.00714.80
7.3.70.0000.01614.86
7.3.60.0090.00614.98
7.3.50.0070.00714.82
7.3.40.0140.00014.99
7.3.30.0040.01214.98
7.3.20.0030.01416.72
7.3.10.0060.00916.73
7.3.00.0120.00316.79
7.2.330.0140.00316.68
7.2.320.0120.01216.77
7.2.310.0040.01216.49
7.2.300.0120.00616.69
7.2.290.0060.01116.51
7.2.250.0080.00815.19
7.2.240.0090.00915.14
7.2.230.0100.00715.34
7.2.220.0100.00315.09
7.2.210.0120.00615.07
7.2.200.0130.00315.25
7.2.190.0030.01314.86
7.2.180.0000.01515.13
7.2.170.0050.00515.04
7.2.60.0050.00316.90
7.2.00.0000.00919.39
7.1.330.0030.01015.75
7.1.320.0030.01015.83
7.1.310.0000.01315.94
7.1.300.0030.00715.80
7.1.290.0040.00715.66
7.1.280.0050.00515.71
7.1.270.0070.00715.66
7.1.260.0110.00415.83
7.1.200.0040.00715.86
7.1.100.0200.00317.85
7.1.70.0090.00017.07
7.1.60.0100.01319.30
7.1.50.0100.01316.86
7.1.00.0030.06722.57
7.0.200.0030.00516.92
7.0.140.0030.07021.99
7.0.120.0100.06722.06
7.0.60.0000.07020.07
7.0.50.0030.07317.80
7.0.40.0000.07720.21
7.0.30.0330.07720.12
7.0.20.0200.04020.23
7.0.10.0030.09720.15
7.0.00.0000.05020.24
5.6.280.0030.07320.82
5.6.210.0130.08020.67
5.6.200.0000.04318.18
5.6.190.0070.04320.47
5.6.180.0470.07720.40
5.6.170.0300.06720.55
5.6.160.0100.03720.39
5.6.150.0030.05018.15
5.6.140.0100.08018.27
5.6.130.0070.07318.14
5.6.120.0000.07320.92
5.6.110.0000.04720.98
5.6.100.0030.04321.04
5.6.90.0100.06321.13
5.6.80.0030.06020.51
5.5.350.0030.03320.45
5.5.340.0100.06717.95
5.5.330.0070.06020.35
5.5.320.2300.05020.30
5.5.310.0300.04320.34
5.5.300.0000.09317.95
5.5.290.0070.06718.01
5.5.280.0100.07720.85
5.5.270.0130.07720.89
5.5.260.0130.05720.88
5.5.250.0070.05320.50
5.5.240.0100.04320.11
5.4.450.0630.04019.31
5.4.440.0570.05719.46
5.4.430.0800.03019.45
5.4.420.0370.03719.54
5.4.410.0900.03319.42
5.4.400.0570.04018.84
5.4.390.0730.03719.22
5.4.380.0670.04318.94
5.4.370.0770.03318.97
5.4.360.0500.02718.83
5.4.350.0770.04019.07
5.4.340.0470.04019.35
5.4.320.0830.03018.86
5.4.310.0830.03719.15
5.4.300.0830.04319.19
5.4.290.0430.04319.21
5.4.280.0300.04018.96
5.4.270.0430.04019.21
5.4.260.0800.04318.94
5.4.250.0870.05018.83
5.4.240.0470.04019.21
5.4.230.0630.03719.21
5.4.220.0370.04318.93
5.4.210.0370.04319.04
5.4.200.0770.04719.18
5.4.190.0270.05018.98
5.4.180.0700.03019.12
5.4.170.0670.03019.02
5.4.160.0770.04019.29
5.4.150.0730.04319.29
5.4.140.0230.04016.40
5.4.130.0200.03316.33
5.4.120.0870.03716.50
5.4.110.0630.03316.43
5.4.100.0230.04016.27
5.4.90.0500.04016.48
5.4.80.0570.04016.54
5.4.70.0430.04016.44
5.4.60.0570.04016.52
5.4.50.0630.03316.41
5.4.40.0600.03316.48
5.4.30.0370.03316.40
5.4.20.0770.03316.48
5.4.10.1130.04016.35
5.4.00.0170.04015.93
5.3.290.0900.03015.93
5.3.280.0570.04015.93
5.3.270.0730.04015.93
5.3.260.0370.04315.93
5.3.250.0600.04715.93
5.3.240.0730.04015.93
5.3.230.0530.03315.93
5.3.220.0700.04715.93
5.3.210.0830.03015.93
5.3.200.0630.03315.93
5.3.190.0700.03715.93
5.3.180.0670.03315.93
5.3.170.0230.04315.93
5.3.160.0670.04015.93
5.3.150.0400.03715.93
5.3.140.0630.05015.93
5.3.130.0670.04715.93
5.3.120.0470.04315.93
5.3.110.0970.04015.93
5.3.100.0630.03315.93
5.3.90.0770.04015.93
5.3.80.0770.03715.93
5.3.70.0970.04315.93
5.3.60.0800.03315.93
5.3.50.0400.03715.93
5.3.40.0670.03715.93
5.3.30.0430.04315.93
5.3.20.0400.03315.93
5.3.10.0730.02715.93
5.3.00.0570.04315.93
5.2.170.0400.03015.93
5.2.160.0700.03315.93
5.2.150.0030.02315.93
5.2.140.0500.02315.93
5.2.130.0400.03315.93
5.2.120.0470.03015.93
5.2.110.0530.02315.93
5.2.100.0730.02715.93
5.2.90.0330.03015.93
5.2.80.0530.04015.93
5.2.70.0570.03715.93
5.2.60.0130.03715.93
5.2.50.0370.05715.93
5.2.40.0400.03715.93
5.2.30.0430.02315.93
5.2.20.0670.01715.93
5.2.10.0270.03015.93
5.2.00.0330.03715.93
5.1.60.0500.02015.93
5.1.50.0630.02315.93
5.1.40.0270.02715.93
5.1.30.0070.03315.93
5.1.20.0430.02015.93
5.1.10.0030.03015.93
5.1.00.0530.03015.93
5.0.50.0170.02015.93
5.0.40.0170.03015.93
5.0.30.0170.03015.93
5.0.20.0400.01715.93
5.0.10.0100.02015.93
5.0.00.0570.02315.93
4.4.90.0300.01715.93
4.4.80.0270.01315.93
4.4.70.0270.01015.93
4.4.60.0300.01715.93
4.4.50.0170.02315.93
4.4.40.0130.03315.93
4.4.30.0270.01315.93
4.4.20.0100.02315.93
4.4.10.0170.01315.93
4.4.00.0070.02715.93
4.3.110.0100.02015.93
4.3.100.0200.01315.93
4.3.90.0100.01715.93
4.3.80.0230.03015.93
4.3.70.0270.01015.93
4.3.60.0230.01315.93
4.3.50.0200.01715.93
4.3.40.0230.02015.93
4.3.30.0170.01715.93
4.3.20.0030.01715.93
4.3.10.0170.01315.93
4.3.00.0100.01315.93

preferences:
44.49 ms | 401 KiB | 5 Q