3v4l.org

run code in 300+ PHP versions simultaneously
<?php $the_mysql_result = array(); $the_mysql_result[0]['id'] = "1"; $the_mysql_result[0]['address']="www.example.com/page1"; $the_mysql_result[0]['title']="Page 1"; $the_mysql_result[0]['content']="The quick dog jumps over the lazy dog."; $the_mysql_result[0]['image']="image_1.jpg"; $the_mysql_result[1]['id'] = "2"; $the_mysql_result[1]['address']="www.example.com/page2"; $the_mysql_result[1]['title']="Page 2"; $the_mysql_result[1]['content']="The best thing about morning is breakfast."; $the_mysql_result[1]['image']="image_2.jpg"; $the_mysql_result[2]['id'] = "3"; $the_mysql_result[2]['address']="www.example.com/page3"; $the_mysql_result[2]['title']="Page 3"; $the_mysql_result[2]['content']="Hotdogs are great ballpark food."; $the_mysql_result[2]['image']="image_3.jpg"; $query="dog"; foreach($the_mysql_result as $results) { $content = $results['content']; $row_occurences = explode($query,$content); foreach($row_occurences as $an_occurence) { $content=$an_occurence.$query; 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($content,strpos($content,$query)-25,160)).'...</p> </div> </li>'; } }

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.00316.63
8.3.50.0160.00522.06
8.3.40.0060.00918.67
8.3.30.0040.01119.17
8.3.20.0040.00420.34
8.3.10.0070.00023.53
8.3.00.0050.00320.64
8.2.180.0130.00916.88
8.2.170.0100.01022.96
8.2.160.0100.00322.15
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00022.16
8.2.110.0030.00619.19
8.2.100.0040.00817.91
8.2.90.0030.00619.36
8.2.80.0040.00417.97
8.2.70.0080.00017.75
8.2.60.0050.00317.93
8.2.50.0030.00618.07
8.2.40.0040.00419.38
8.2.30.0020.00518.12
8.2.20.0060.00317.85
8.2.10.0000.00717.71
8.2.00.0040.00417.80
8.1.280.0120.00925.92
8.1.270.0040.00423.79
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00021.26
8.1.230.0040.00717.58
8.1.220.0050.00317.91
8.1.210.0090.00018.77
8.1.200.0030.00617.35
8.1.190.0040.00417.48
8.1.180.0040.00418.10
8.1.170.0050.00318.41
8.1.160.0070.00022.13
8.1.150.0000.00718.74
8.1.140.0100.00017.42
8.1.130.0070.00017.88
8.1.120.0000.00717.59
8.1.110.0040.00417.51
8.1.100.0040.00417.50
8.1.90.0020.00517.58
8.1.80.0030.00317.51
8.1.70.0030.00517.47
8.1.60.0000.00817.47
8.1.50.0000.00817.56
8.1.40.0000.00717.54
8.1.30.0040.00417.76
8.1.20.0060.00317.63
8.1.10.0000.00817.58
8.1.00.0000.00817.59
8.0.300.0040.00418.77
8.0.290.0060.00316.58
8.0.280.0030.00318.45
8.0.270.0000.00717.20
8.0.260.0000.00616.87
8.0.250.0040.00416.98
8.0.240.0080.00017.09
8.0.230.0050.00217.00
8.0.220.0000.00716.95
8.0.210.0050.00216.96
8.0.200.0040.00417.04
8.0.190.0040.00416.96
8.0.180.0000.00817.03
8.0.170.0050.00316.88
8.0.160.0040.00416.93
8.0.150.0070.00016.85
8.0.140.0040.00416.89
8.0.130.0050.00013.38
8.0.120.0040.00416.89
8.0.110.0040.00416.96
8.0.100.0000.00816.86
8.0.90.0020.00516.80
8.0.80.0130.00716.84
8.0.70.0000.00816.78
8.0.60.0000.00717.07
8.0.50.0000.00716.78
8.0.30.0140.00817.32
8.0.20.0090.01017.40
8.0.10.0060.00317.14
8.0.00.0140.00416.82
7.4.330.0000.00515.14
7.4.320.0030.00316.49
7.4.300.0030.00316.68
7.4.290.0030.00316.58
7.4.280.0030.00316.71
7.4.270.0000.00716.69
7.4.260.0040.00416.63
7.4.250.0000.00716.55
7.4.240.0030.00416.52
7.4.230.0080.00016.43
7.4.220.0100.00716.68
7.4.210.0060.00916.61
7.4.200.0070.00016.41
7.4.190.0070.00016.83
7.4.160.0130.00316.78
7.4.150.0100.01417.40
7.4.140.0120.00617.86
7.4.130.0100.00816.69
7.4.120.0070.01016.59
7.4.110.0050.01116.59
7.4.100.0130.01016.47
7.4.90.0070.01116.70
7.4.80.0110.00716.58
7.4.70.0090.00916.66
7.4.60.0150.00416.67
7.4.50.0060.00316.37
7.4.40.0060.01222.77
7.4.30.0040.01116.53
7.4.00.0080.00415.03
7.3.330.0000.00613.11
7.3.320.0050.00013.26
7.3.310.0070.00016.46
7.3.300.0040.00416.36
7.3.290.0040.01116.29
7.3.280.0090.00916.36
7.3.270.0070.01117.40
7.3.260.0070.01016.32
7.3.250.0090.00816.58
7.3.240.0120.00916.48
7.3.230.0060.01116.39
7.3.210.0110.00716.71
7.3.200.0120.00919.39
7.3.190.0070.01116.43
7.3.180.0090.01216.37
7.3.170.0040.01216.64
7.3.160.0080.00816.30
7.3.120.0060.00914.95
7.3.10.0040.00816.16
7.3.00.0040.00416.78
7.2.330.0130.00316.68
7.2.320.0100.00716.71
7.2.310.0060.00916.70
7.2.300.0110.00816.78
7.2.290.0080.01016.79
7.2.130.0000.01516.91
7.2.120.0000.00916.86
7.2.110.0000.01216.89
7.2.100.0030.00916.92
7.2.90.0060.00916.95
7.2.80.0030.01216.98
7.2.70.0080.00416.82
7.2.60.0030.00916.75
7.2.50.0100.00316.75
7.2.40.0070.00716.95
7.2.30.0100.00016.71
7.2.20.0120.00016.75
7.2.10.0070.00416.88
7.2.00.0070.00718.10
7.1.250.0000.01115.71
7.1.100.0030.00918.27
7.1.70.0030.00517.38
7.1.60.0030.01017.24
7.1.50.0240.00016.95
7.1.00.0000.07722.33
7.0.200.0060.01016.88
7.0.140.0000.07322.18
7.0.100.0200.07019.95
7.0.90.0430.09020.11
7.0.80.0130.08019.96
7.0.70.0030.08719.98
7.0.60.0070.07719.83
7.0.50.0470.07020.23
7.0.40.0070.08020.05
7.0.30.0030.08720.18
7.0.20.0230.07020.11
7.0.10.0030.07720.10
7.0.00.0070.07719.94
5.6.280.0000.07720.92
5.6.250.0130.04320.65
5.6.240.0030.08020.64
5.6.230.0170.07020.63
5.6.220.0130.05720.57
5.6.210.0070.04020.63
5.6.200.0030.05721.10
5.6.190.0000.08021.13
5.6.180.0130.08320.96
5.6.170.0030.06320.96
5.6.160.0170.07720.97
5.6.150.0070.08721.05
5.6.140.0170.08321.03
5.6.130.0100.08021.09
5.6.120.0230.06721.13
5.6.110.0000.10021.07
5.6.100.0130.07721.10
5.6.90.0100.08320.94
5.6.80.0070.07020.48
5.6.70.0030.06720.40
5.6.60.0030.08020.42
5.6.50.0070.04320.56
5.6.40.0070.03320.41
5.6.30.0070.04320.42
5.6.20.0030.03320.47
5.6.10.0030.04020.38
5.6.00.0070.03020.43
5.5.380.0130.08020.38
5.5.370.0100.08020.46
5.5.360.0200.07020.47
5.5.350.0100.05020.33
5.5.340.0000.08720.79
5.5.330.0070.07720.84
5.5.320.0130.06320.92
5.5.310.0070.07020.80
5.5.300.0170.05720.83
5.5.290.0100.07720.84
5.5.280.0200.07320.89
5.5.270.0070.08020.81
5.5.260.0030.07320.89
5.5.250.0170.07720.70
5.5.240.0000.08720.23
5.5.230.0270.05320.27
5.5.220.0100.05320.24
5.5.210.0070.07020.24
5.5.200.0070.04320.25
5.5.190.0030.04320.26
5.5.180.0070.03320.29
5.5.160.0030.04020.24
5.5.150.0130.03020.18
5.5.140.0100.03320.19
5.5.130.0100.03720.26
5.5.120.0130.03020.27
5.5.110.0070.03720.21
5.5.100.0030.06020.18
5.5.90.0070.03020.17
5.5.80.0070.06720.08
5.5.70.0000.05320.07
5.5.60.0070.05320.06
5.5.50.0070.03720.12
5.5.40.0130.02720.07
5.5.30.0030.03320.06
5.5.20.0130.07019.96
5.5.10.0030.03019.97
5.5.00.0070.03320.05
5.4.450.0100.07719.47
5.4.440.0170.06719.43
5.4.430.0030.05319.43
5.4.420.0030.08019.29
5.4.410.0100.07019.16
5.4.400.0000.08318.98
5.4.390.0100.07319.03
5.4.380.0070.06718.95
5.4.370.0030.04318.95
5.4.360.0100.03719.10
5.4.350.0000.04319.20
5.4.340.0070.03319.12
5.4.320.0000.03319.09
5.4.310.0000.04018.98
5.4.300.0100.03019.10
5.4.290.0000.04319.04
5.4.280.0000.04319.23
5.4.270.0030.03719.07
5.4.260.0070.03719.12
5.4.250.0070.03018.97
5.4.240.0000.03319.07
5.4.230.0000.04319.14
5.4.220.0100.02719.21
5.4.210.0070.03319.04
5.4.200.0030.03718.80
5.4.190.0070.03019.09
5.4.180.0100.04319.13
5.4.170.0070.03719.03
5.4.160.0070.06318.76
5.4.150.0070.03318.88
5.4.140.0000.03316.27
5.4.130.0030.03316.27
5.4.120.0030.04016.02
5.4.110.0030.03316.36
5.4.100.0030.03716.46
5.4.90.0030.03716.45
5.4.80.0100.03016.31
5.4.70.0030.03016.42
5.4.60.0030.03716.19
5.4.50.0070.03316.20
5.4.40.0030.04316.33
5.4.30.0100.06016.38
5.4.20.0100.06716.20
5.4.10.0070.07016.29
5.4.00.0000.04315.81
5.3.290.0030.03714.54
5.3.280.0000.04014.43
5.3.270.0070.03314.59
5.3.260.0000.04014.63
5.3.250.0000.04014.46
5.3.240.0000.03314.50
5.3.230.0000.04014.61
5.3.220.0000.03714.45
5.3.210.0000.04014.49
5.3.200.0030.03714.57
5.3.190.0000.04014.44
5.3.180.0000.03314.54
5.3.170.0070.03314.58
5.3.160.0100.06014.53
5.3.150.0030.05014.59
5.3.140.0070.06714.43
5.3.130.0070.06314.52
5.3.120.0130.03314.43
5.3.110.0070.05014.56
5.3.100.0230.02714.05
5.3.90.0000.07713.90
5.3.80.0030.04314.03
5.3.70.0130.04013.98
5.3.60.0030.04713.97
5.3.50.0030.07313.84
5.3.40.0100.06713.96
5.3.30.0070.07313.90
5.3.20.0070.07313.46
5.3.10.0070.06313.66
5.3.00.0230.06013.65
5.2.170.0000.03711.21
5.2.160.0000.04711.14
5.2.150.0070.05711.21
5.2.140.0130.06011.16
5.2.130.0100.05710.96
5.2.120.0070.04011.14
5.2.110.0100.05011.07
5.2.100.0030.06010.95
5.2.90.0070.06311.14
5.2.80.0070.06310.90
5.2.70.0170.04011.03
5.2.60.0030.06011.05
5.2.50.0070.05710.98
5.2.40.0070.06011.04
5.2.30.0070.05011.01
5.2.20.0030.06710.81
5.2.10.0000.03310.80
5.2.00.0070.05010.59
5.1.60.0030.02710.06
5.1.50.0030.05710.06
5.1.40.0000.03010.02
5.1.30.0000.03010.17
5.1.20.0030.02710.41
5.1.10.0000.03710.11
5.1.00.0070.02710.09
5.0.50.0100.0338.40
5.0.40.0000.0208.42
5.0.30.0130.0408.29
5.0.20.0030.0438.24
5.0.10.0070.0278.29
5.0.00.0070.0308.24
4.4.90.0030.0408.24
4.4.80.0030.0178.24
4.4.70.0000.0308.24
4.4.60.0070.0308.24
4.4.50.0070.0308.24
4.4.40.0030.0508.24
4.4.30.0000.0408.24
4.4.20.0000.0308.24
4.4.10.0070.0178.24
4.4.00.0070.0338.24
4.3.110.0000.0278.24
4.3.100.0000.0338.24
4.3.90.0000.0378.24
4.3.80.0000.0578.24
4.3.70.0030.0208.24
4.3.60.0000.0338.24
4.3.50.0000.0378.24
4.3.40.0000.0578.24
4.3.30.0000.0378.24
4.3.20.0000.0308.24
4.3.10.0030.0308.24
4.3.00.0000.0278.24

preferences:
41.84 ms | 401 KiB | 5 Q