3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mysql_result[0]['id']="1"; $mysql_result[1]['id']="2"; $mysql_result[2]['id']="3"; $mysql_result[0]['address']="www.example.com/page1"; $mysql_result[1]['address']="www.example.com/page2"; $mysql_result[2]['address']="www.example.com/page3"; $mysql_result[0]['title']="Page 1"; $mysql_result[1]['title']="Page 2"; $mysql_result[2]['title']="Page 3"; $mysql_result[0]['content']="The quick dog jumps over the lazy dog."; $mysql_result[1]['content']="The best thing about morning is breakfast."; $mysql_result[2]['content']="Hotdogs are great ballpark food."; $mysql_result[0]['image']="image1.jpg"; $mysql_result[1]['image']="image2.jpg"; $mysql_result[2]['image']="image3.jpg"; $query="dog"; $chars_to_show_before = 10; $chars_to_show_after = 10; foreach($mysql_result as $results) { $content = str_replace($query,"my_un1qu3_r3pl4c3m3nt_".$query,$results['content']); $occurences = explode("my_un1qu3_r3pl4c3m3nt_",$content); $position_in_original_content = 0; foreach($occurences as $an_occurence) { if (strpos($an_occurence,$query) !== false) { $content=$an_occurence; echo "\npos $position_in_original_content\n"; echo "\n\nworking on \n".substr($results['content'],$position_in_original_content-$chars_to_show_before,strlen(strlen($query))+$chars_to_show_after+$chars_to_show_before)."\n\n"; echo '<li class="media"> <a class="pull-left" href="'.$results['address'].'"> <img class="media-object thumbnail" src="'.$results['image'].'" style="height:100px !important"> </a> <div class="media-body"> <h4 class="media-heading"><a href="'.$results['address'].'">'.$results['title'].'</a></h4> <p>...'.str_replace($query,'<strong>'.$query.'</strong>', substr($results['content'],$position_in_original_content-$chars_to_show_before,strlen(strlen($query))+$chars_to_show_after+$chars_to_show_before)).'...</p> </div>'.($position_in_original_content-0).' and '.(strlen($an_occurence)+0).' </li>'; } $position_in_original_content = $position_in_original_content + strlen($an_occurence); } }

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.0100.00616.50
8.3.50.0090.01018.26
8.3.40.0040.01218.82
8.3.30.0120.00318.79
8.3.20.0080.00018.77
8.3.10.0030.00618.77
8.3.00.0000.00819.26
8.2.180.0100.01016.50
8.2.170.0040.01122.96
8.2.160.0160.00018.91
8.2.150.0160.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00420.59
8.2.110.0030.00622.16
8.2.100.0060.00619.39
8.2.90.0040.00417.50
8.2.80.0000.00818.67
8.2.70.0000.01017.50
8.2.60.0000.00818.04
8.2.50.0040.00418.07
8.2.40.0000.00819.87
8.2.30.0030.00617.89
8.2.20.0070.00417.80
8.2.10.0030.00517.77
8.2.00.0040.00417.67
8.1.280.0140.00025.92
8.1.270.0030.00623.99
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00620.64
8.1.230.0060.00617.80
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00717.23
8.1.190.0080.00017.35
8.1.180.0060.00318.10
8.1.170.0040.00418.88
8.1.160.0030.00518.97
8.1.150.0030.00618.60
8.1.140.0030.00517.42
8.1.130.0030.00317.87
8.1.120.0030.00317.58
8.1.110.0000.00717.46
8.1.100.0000.00717.55
8.1.90.0040.00417.49
8.1.80.0000.00717.51
8.1.70.0000.00717.46
8.1.60.0030.00617.63
8.1.50.0000.00717.51
8.1.40.0050.00217.51
8.1.30.0050.00517.64
8.1.20.0000.00917.69
8.1.10.0000.00817.58
8.1.00.0030.00517.57
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0020.00518.66
8.0.270.0070.00017.27
8.0.260.0070.00016.81
8.0.250.0000.00817.09
8.0.240.0000.00716.92
8.0.230.0040.00417.05
8.0.220.0050.00216.93
8.0.210.0030.00316.95
8.0.200.0030.00317.05
8.0.190.0040.00316.99
8.0.180.0060.00316.85
8.0.170.0030.00616.80
8.0.160.0030.00316.85
8.0.150.0050.00316.87
8.0.140.0040.00416.94
8.0.130.0030.00313.37
8.0.120.0070.00516.87
8.0.110.0000.00716.85
8.0.100.0040.00416.96
8.0.90.0000.00716.95
8.0.80.0030.01716.89
8.0.70.0040.00416.81
8.0.60.0000.00816.76
8.0.50.0040.00416.97
8.0.30.0100.01317.12
8.0.20.0140.00517.16
8.0.10.0000.00817.18
8.0.00.0080.01316.80
7.4.330.0020.00213.04
7.4.320.0030.00316.64
7.4.300.0000.00616.70
7.4.290.0000.00716.67
7.4.280.0040.00416.55
7.4.270.0030.00316.70
7.4.260.0060.00313.36
7.4.250.0000.00816.48
7.4.240.0000.00716.66
7.4.230.0000.00716.55
7.4.220.0030.01216.70
7.4.210.0060.01016.44
7.4.200.0000.00716.73
7.4.190.0070.00016.71
7.4.160.0120.00316.35
7.4.150.0120.00616.60
7.4.140.0100.00716.55
7.4.130.0110.00716.69
7.4.120.0140.00316.51
7.4.110.0070.01116.48
7.4.100.0090.01216.60
7.4.90.0090.00916.52
7.4.80.0100.00719.39
7.4.70.0090.00916.38
7.4.60.0030.01316.45
7.4.50.0070.00516.26
7.4.40.0140.00416.52
7.4.30.0070.01016.52
7.4.00.0040.01214.99
7.3.330.0060.00013.22
7.3.320.0030.00313.29
7.3.310.0000.00716.21
7.3.300.0000.00716.22
7.3.290.0080.00716.35
7.3.280.0080.01216.42
7.3.270.0070.01016.43
7.3.260.0190.00316.69
7.3.250.0090.01016.34
7.3.240.0030.01316.38
7.3.230.0110.01116.34
7.3.210.0100.00716.33
7.3.200.0050.01116.58
7.3.190.0100.00716.51
7.3.180.0060.01016.51
7.3.170.0090.01216.54
7.3.160.0150.00416.62
7.3.120.0030.01015.03
7.3.10.0080.00616.39
7.3.00.0030.01016.56
7.2.330.0100.00716.55
7.2.320.0070.01016.80
7.2.310.0060.01316.82
7.2.300.0130.00416.65
7.2.290.0120.00616.78
7.2.130.0000.01217.13
7.2.120.0090.00616.79
7.2.110.0060.00916.97
7.2.100.0080.00617.04
7.2.90.0030.01216.98
7.2.80.0000.01016.93
7.2.70.0090.00617.13
7.2.60.0110.00016.96
7.2.50.0060.00917.16
7.2.40.0030.01017.13
7.2.30.0030.00717.04
7.2.20.0140.00316.96
7.2.10.0000.01517.16
7.2.00.0040.00818.17
7.1.250.0090.00315.65
7.1.100.0030.00718.30
7.1.70.0030.00517.19
7.1.60.0100.01319.30
7.1.50.0120.00916.91
7.1.00.0000.07722.46
7.0.200.0130.00016.32
7.0.140.0100.06722.09
7.0.120.0030.05722.18
7.0.60.0070.08719.95
7.0.50.0230.06317.95
7.0.40.0070.06320.21
7.0.30.0270.08320.04
7.0.20.0230.07720.20
7.0.10.0330.07720.04
7.0.00.0230.06020.16
5.6.280.0030.07721.11
5.6.210.0130.07720.62
5.6.200.0100.04718.13
5.6.190.0070.08320.56
5.6.180.0030.05020.59
5.6.170.0200.04320.48
5.6.160.0100.08020.38
5.6.150.0070.07318.21
5.6.140.0100.07318.07
5.6.130.0030.05018.17
5.6.120.0070.05321.07
5.6.110.0100.06721.00
5.6.100.0070.05321.00
5.6.90.0070.04021.05
5.6.80.0070.07720.44
5.6.70.0170.07720.52
5.5.350.0230.05020.40
5.5.340.0100.07018.02
5.5.330.0170.06020.07
5.5.320.0100.07020.07
5.5.310.0370.06720.31
5.5.300.0130.03017.91
5.5.290.0030.08717.96
5.5.280.0000.05020.99
5.5.270.0070.08320.88
5.5.260.0130.07020.88
5.5.250.0030.05720.56
5.5.240.0070.08320.30
5.4.450.0100.03319.25
5.4.440.0030.04019.24
5.4.430.0030.03719.32
5.4.420.0000.04019.24
5.4.410.0130.04019.14
5.4.400.0030.08319.12
5.4.390.0030.08319.18
5.4.380.0070.07018.79
5.4.370.0100.07019.17
5.4.360.0100.08019.07
5.4.350.0170.07019.17
5.4.340.0130.05018.81
5.4.320.0100.07318.79
5.4.310.0030.07018.92
5.4.300.0070.04719.08
5.4.290.0130.07319.15
5.4.280.0070.05018.80
5.4.270.0100.07719.08
5.4.260.0030.05318.91
5.4.250.0070.07019.19
5.4.240.0070.04019.07
5.4.230.0100.03319.17
5.4.220.0030.05318.90
5.4.210.0070.04319.17
5.4.200.0000.07319.07
5.4.190.0100.06718.91
5.4.180.0130.05318.80
5.4.170.0030.07719.13
5.4.160.0070.05019.12
5.4.150.0130.07018.76
5.4.140.0070.05016.38
5.4.130.0070.06316.25
5.4.120.0070.04316.16
5.4.110.0030.04716.41
5.4.100.0030.04716.32
5.4.90.0070.07316.23
5.4.80.0100.07016.33
5.4.70.0100.07316.33
5.4.60.0100.07316.19
5.4.50.0070.05716.21
5.4.40.0030.07716.36
5.4.30.0070.04316.21
5.4.20.0000.05016.34
5.4.10.0030.08016.31
5.4.00.0100.06015.71
5.3.290.0100.06014.66
5.3.280.0030.04714.55
5.3.270.0070.04314.57
5.3.260.0100.04014.56
5.3.250.0070.06314.72
5.3.240.0030.06314.51
5.3.230.0130.07014.60
5.3.220.0070.06014.68
5.3.210.0000.07014.41
5.3.200.0130.03014.49
5.3.190.0230.06014.53
5.3.180.0130.06714.53
5.3.170.0100.08014.52
5.3.160.0070.07714.55
5.3.150.0070.04714.46
5.3.140.0000.06714.51
5.3.130.0100.03314.52
5.3.120.0130.04014.66
5.3.110.0130.06014.50
5.3.100.0100.07314.00
5.3.90.0070.06713.98
5.3.80.0070.03713.97
5.3.70.0100.06013.97
5.3.60.0100.06013.97
5.3.50.0000.04013.95
5.3.40.0030.08313.94
5.3.30.0130.06713.91
5.3.20.0130.07013.64
5.3.10.0130.06313.65
5.3.00.0100.07013.61
5.2.170.0100.06011.17
5.2.160.0030.06711.11
5.2.150.0030.03311.26
5.2.140.0030.05311.11
5.2.130.0070.06011.10
5.2.120.0000.07011.10
5.2.110.0070.04311.02
5.2.100.0030.06011.02
5.2.90.0100.05011.06
5.2.80.0100.05311.27
5.2.70.0070.04311.20
5.2.60.0100.04311.02
5.2.50.0100.06010.90
5.2.40.0170.02310.93
5.2.30.0030.04010.96
5.2.20.0030.03310.97
5.2.10.0030.06310.88
5.2.00.0030.06010.80
5.1.60.0130.0279.98
5.1.50.0030.0539.97
5.1.40.0130.0279.91
5.1.30.0000.04010.50
5.1.20.0000.06310.38
5.1.10.0030.04010.13
5.1.00.0030.04710.15
5.0.50.0070.0438.48
5.0.40.0070.0408.39
5.0.30.0000.0708.40
5.0.20.0070.0438.21
5.0.10.0070.0208.27
5.0.00.0030.0638.10
4.4.90.0000.0377.98
4.4.80.0000.0237.98
4.4.70.0000.0377.98
4.4.60.0000.0377.98
4.4.50.0000.0277.98
4.4.40.0000.0607.98
4.4.30.0030.0237.98
4.4.20.0100.0308.00
4.4.10.0030.0208.00
4.4.00.0070.0538.00
4.3.110.0030.0278.00
4.3.100.0000.0308.00
4.3.90.0000.0178.00
4.3.80.0070.0508.00
4.3.70.0070.0338.00
4.3.60.0030.0238.00
4.3.50.0030.0338.00
4.3.40.0070.0438.00
4.3.30.0000.0308.00
4.3.20.0030.0378.00
4.3.10.0000.0378.00
4.3.00.0000.0338.00

preferences:
52.19 ms | 400 KiB | 5 Q