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)
5.4.160.0230.03712.38
5.4.150.0320.05812.38
5.4.140.0130.04512.07
5.4.130.0150.04612.05
5.4.120.0150.04312.01
5.4.110.0250.06512.01
5.4.100.0150.04512.01
5.4.90.0190.04112.01
5.4.80.0110.04712.01
5.4.70.0160.04312.01
5.4.60.0200.06712.00
5.4.50.0210.05312.00
5.4.40.0170.04111.99
5.4.30.0100.04611.99
5.4.20.0180.04211.99
5.4.10.0240.06411.99
5.4.00.0150.04111.48
5.3.260.0130.04912.72
5.3.250.0130.04712.72
5.3.240.0140.04812.72
5.3.230.0260.06912.71
5.3.220.0140.04712.68
5.3.210.0190.04312.68
5.3.200.0250.06412.68
5.3.190.0160.04712.68
5.3.180.0180.04312.67
5.3.170.0160.04312.67
5.3.160.0320.07312.67
5.3.150.0200.05712.67
5.3.140.0140.04612.66
5.3.130.0210.04112.66
5.3.120.0140.04512.65
5.3.110.0160.04212.66
5.3.100.0180.07112.12
5.3.90.0220.05312.09
5.3.80.0270.06412.08
5.3.70.0150.04512.08
5.3.60.0140.04612.07
5.3.50.0130.04612.01
5.3.40.0140.04512.01
5.3.30.0220.06811.99
5.3.20.0140.04311.76
5.3.10.0120.04311.72
5.3.00.0150.04111.70

preferences:
140.09 ms | 1394 KiB | 7 Q