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>'; $total++; } }

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.0130.00716.62
8.3.50.0160.00521.21
8.3.40.0000.01518.72
8.3.30.0070.00718.79
8.3.20.0080.00018.88
8.3.10.0050.00320.64
8.3.00.0050.00221.89
8.2.180.0090.01216.50
8.2.170.0090.00922.96
8.2.160.0100.00320.52
8.2.150.0000.00924.18
8.2.140.0150.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00319.41
8.2.110.0060.00322.11
8.2.100.0040.00817.97
8.2.90.0050.00319.22
8.2.80.0090.00017.97
8.2.70.0060.00317.75
8.2.60.0000.01118.04
8.2.50.0080.00018.07
8.2.40.0030.00618.34
8.2.30.0000.00819.89
8.2.20.0040.00417.91
8.2.10.0000.00819.69
8.2.00.0060.00317.85
8.1.270.0040.00423.99
8.1.260.0060.01326.35
8.1.250.0000.00828.09
8.1.240.0060.00322.51
8.1.230.0000.01120.98
8.1.220.0050.00318.77
8.1.210.0040.00418.86
8.1.200.0060.00317.38
8.1.190.0020.00517.76
8.1.180.0000.00818.10
8.1.170.0000.00818.68
8.1.160.0040.00419.01
8.1.150.0000.00718.74
8.1.140.0050.00317.52
8.1.130.0030.00317.95
8.1.120.0000.00717.58
8.1.110.0060.00317.52
8.1.100.0050.00317.55
8.1.90.0030.00517.51
8.1.80.0050.00217.42
8.1.70.0030.00317.49
8.1.60.0030.01017.54
8.1.50.0040.00417.45
8.1.40.0000.00717.61
8.1.30.0050.00217.70
8.1.20.0050.00317.77
8.1.10.0080.00017.65
8.1.00.0040.00417.55
8.0.300.0040.00419.98
8.0.290.0000.01116.88
8.0.280.0030.00318.51
8.0.270.0070.00017.20
8.0.260.0030.00316.83
8.0.250.0030.00616.97
8.0.240.0080.00317.12
8.0.230.0000.00717.09
8.0.220.0040.00417.05
8.0.210.0070.00016.92
8.0.200.0040.00417.05
8.0.190.0100.00017.02
8.0.180.0050.00317.01
8.0.170.0040.00417.00
8.0.160.0030.00317.13
8.0.150.0030.00616.91
8.0.140.0030.00417.03
8.0.130.0060.00313.45
8.0.120.0000.00817.01
8.0.110.0000.00716.93
8.0.100.0050.00216.96
8.0.90.0040.00417.02
8.0.80.0120.00317.05
8.0.70.0040.00416.93
8.0.60.0040.00416.92
8.0.50.0050.00217.05
8.0.30.0100.00817.25
8.0.20.0140.00717.40
8.0.10.0000.00717.19
8.0.00.0170.00516.81
7.4.330.0060.00014.80
7.4.320.0030.00316.56
7.4.300.0070.00016.57
7.4.290.0070.00016.71
7.4.280.0040.00416.71
7.4.270.0030.00616.45
7.4.260.0050.00013.36
7.4.250.0000.00716.53
7.4.240.0080.00016.60
7.4.230.0000.00716.54
7.4.220.0120.00316.55
7.4.210.0090.00816.58
7.4.200.0040.00416.40
7.4.190.0070.00016.48
7.4.160.0060.00916.63
7.4.150.0140.00317.40
7.4.140.0080.01017.86
7.4.130.0050.01216.48
7.4.120.0070.01016.69
7.4.110.0100.01016.68
7.4.100.0090.00916.59
7.4.90.0100.00716.47
7.4.80.0070.01019.37
7.4.70.0090.00616.77
7.4.60.0090.00616.25
7.4.50.0050.00016.46
7.4.40.0110.00722.27
7.4.30.0070.01016.81
7.4.10.0050.01515.01
7.4.00.0100.00614.93
7.3.330.0030.00313.35
7.3.320.0030.00313.25
7.3.310.0000.00716.40
7.3.300.0030.00316.47
7.3.290.0030.01216.54
7.3.280.0100.00416.41
7.3.270.0130.00317.40
7.3.260.0110.00618.24
7.3.250.0120.00616.57
7.3.240.0100.00716.46
7.3.230.0100.01416.43
7.3.210.0070.01016.59
7.3.200.0030.01319.39
7.3.190.0030.01516.61
7.3.180.0090.00616.32
7.3.170.0080.00816.43
7.3.160.0060.00916.30
7.3.130.0050.01114.97
7.3.120.0070.01114.88
7.3.110.0050.01214.94
7.3.100.0100.00514.84
7.3.90.0080.00415.07
7.3.80.0070.00815.06
7.3.70.0040.00714.80
7.3.60.0050.00814.88
7.3.50.0050.00914.94
7.3.40.0040.00614.88
7.3.30.0090.00314.83
7.3.20.0050.00516.66
7.3.10.0030.00816.54
7.3.00.0070.00516.80
7.2.330.0070.01016.62
7.2.320.0040.02016.53
7.2.310.0130.00616.81
7.2.300.0180.00016.52
7.2.290.0060.01116.63
7.2.260.0080.01315.02
7.2.250.0050.01315.24
7.2.240.0060.00914.87
7.2.230.0100.00514.95
7.2.220.0050.01215.00
7.2.210.0050.01015.13
7.2.200.0050.00914.99
7.2.190.0030.01114.95
7.2.180.0040.01015.12
7.2.170.0070.00914.99
7.2.160.0050.00715.05
7.2.150.0060.00516.93
7.2.140.0090.00216.87
7.2.130.0050.00817.12
7.2.120.0030.00816.95
7.2.110.0080.00516.91
7.2.100.0040.00516.91
7.2.90.0080.00716.92
7.2.80.0050.01216.97
7.2.70.0070.00817.13
7.2.60.0110.00916.94
7.2.50.0060.00817.00
7.2.40.0110.00516.96
7.2.30.0030.01417.04
7.2.20.0070.00516.92
7.2.10.0030.01216.96
7.2.00.0050.01116.98
7.1.330.0090.00415.61
7.1.320.0070.00715.68
7.1.310.0110.00315.91
7.1.300.0060.00515.85
7.1.290.0020.00915.75
7.1.280.0080.00415.60
7.1.270.0070.00515.79
7.1.260.0060.00515.94
7.1.250.0050.00815.76
7.1.240.0020.00915.78
7.1.230.0000.01316.00
7.1.220.0030.00815.94
7.1.210.0120.00315.88
7.1.200.0080.00615.74
7.1.190.0060.00815.83
7.1.180.0070.00715.83
7.1.170.0050.00715.87
7.1.160.0030.01015.73
7.1.150.0050.00715.87
7.1.140.0030.00815.74
7.1.130.0100.00415.79
7.1.120.0070.00415.62
7.1.110.0050.00615.89
7.1.100.0070.00716.67
7.1.90.0060.01015.75
7.1.80.0080.00615.79
7.1.70.0040.00816.16
7.1.60.0060.00917.06
7.1.50.0090.00716.31
7.1.40.0140.00215.63
7.1.30.0050.00815.84
7.1.20.0050.00715.78
7.1.10.0060.00515.75
7.1.00.0040.02318.18
7.0.330.0050.00715.41
7.0.320.0050.00815.34
7.0.310.0040.00915.23
7.0.300.0050.00615.55
7.0.290.0030.00815.53
7.0.280.0020.00915.48
7.0.270.0080.00515.18
7.0.260.0050.00915.47
7.0.250.0070.00815.39
7.0.240.0050.00515.33
7.0.230.0020.00915.55
7.0.220.0090.00515.24
7.0.210.0020.00815.43
7.0.200.0070.00615.91
7.0.190.0070.00815.29
7.0.180.0060.00815.55
7.0.170.0090.00615.36
7.0.160.0060.00615.40
7.0.150.0050.00915.41
7.0.140.0000.03417.63
7.0.130.0070.00915.44
7.0.120.0050.00615.32
7.0.110.0050.00415.48
7.0.100.0060.00815.56
7.0.90.0030.01015.55
7.0.80.0080.00615.43
7.0.70.0030.00815.39
7.0.60.0080.01717.02
7.0.50.0060.03016.34
7.0.40.0040.03415.11
7.0.30.0070.01915.12
7.0.20.0070.03115.16
7.0.10.0040.03215.15
7.0.00.0060.03215.13
5.6.400.0070.00514.53
5.6.390.0050.00714.42
5.6.380.0050.00814.70
5.6.370.0070.00714.48
5.6.360.0050.00814.61
5.6.350.0030.01114.55
5.6.340.0050.00714.38
5.6.330.0030.01014.45
5.6.320.0080.00714.53
5.6.310.0070.00714.48
5.6.300.0030.01014.51
5.6.290.0070.00914.46
5.6.280.0050.02916.66
5.6.270.0060.00714.68
5.6.260.0090.00814.47
5.6.250.0060.00914.59
5.6.240.0030.01014.44
5.6.230.0030.00914.37
5.6.220.0060.00814.54
5.6.210.0040.03516.42
5.6.200.0110.02915.81
5.6.190.0080.02015.72
5.6.180.0090.03115.65
5.6.170.0030.03415.73
5.6.160.0100.02215.79
5.6.150.0040.02115.67
5.6.140.0080.02315.66
5.6.130.0070.01815.64
5.6.120.0060.01815.72
5.6.110.0080.03015.67
5.6.100.0050.02215.63
5.6.90.0070.03115.68
5.6.80.0050.03315.42
5.6.70.0070.03115.59
5.6.60.0050.03615.40
5.6.50.0050.01915.51
5.6.40.0130.01615.49
5.6.30.0070.03115.39
5.6.20.0080.02515.37
5.6.10.0050.02915.52
5.6.00.0050.02815.41
5.5.380.0060.00614.64
5.5.370.0050.00714.19
5.5.360.0110.00614.47
5.5.350.0110.02616.40
5.5.340.0060.02515.50
5.5.330.0030.03215.67
5.5.320.0100.01515.72
5.5.310.0060.02815.63
5.5.300.0030.02215.58
5.5.290.0060.03415.55
5.5.280.0050.03515.70
5.5.270.0050.03315.62
5.5.260.0070.01915.66
5.5.250.0050.03215.49
5.5.240.0060.01815.41
5.5.230.0110.01415.48
5.5.220.0040.03015.38
5.5.210.0110.02815.46
5.5.200.0100.02915.41
5.5.190.0050.02715.38
5.5.180.0060.03315.33
5.5.170.0060.00814.52
5.5.160.0030.02515.40
5.5.150.0070.02615.41
5.5.140.0070.02015.28
5.5.130.0020.02215.40
5.5.120.0060.02015.45
5.5.110.0090.03215.28
5.5.100.0020.02515.24
5.5.90.0050.03015.34
5.5.80.0070.01515.25
5.5.70.0040.03015.16
5.5.60.0070.02915.26
5.5.50.0090.02415.34
5.5.40.0060.01815.23
5.5.30.0070.02715.38
5.5.20.0060.03315.37
5.5.10.0060.02615.38
5.5.00.0060.02915.05
5.4.450.0100.02815.67
5.4.440.0070.02915.66
5.4.430.0080.01915.66
5.4.420.0050.01815.66
5.4.410.0030.03315.59
5.4.400.0090.02515.55
5.4.390.0060.02315.55
5.4.380.0060.02015.59
5.4.370.0070.01715.57
5.4.360.0080.03015.63
5.4.350.0020.02815.55
5.4.340.0090.02415.59
5.4.330.0070.00313.84
5.4.320.0030.02215.50
5.4.310.0060.01915.57
5.4.300.0090.01315.63
5.4.290.0060.02015.57
5.4.280.0030.01815.55
5.4.270.0020.03215.50
5.4.260.0080.02615.55
5.4.250.0040.03015.59
5.4.240.0060.02215.56
5.4.230.0080.02415.60
5.4.220.0060.02915.50
5.4.210.0040.01815.59
5.4.200.0020.02115.60
5.4.190.0050.02915.56
5.4.180.0060.02915.62
5.4.170.0050.02415.57
5.4.160.0050.03015.56
5.4.150.0030.03215.55
5.4.140.0050.02914.71
5.4.130.0050.01414.66
5.4.120.0060.02714.67
5.4.110.0020.02214.68
5.4.100.0050.02814.64
5.4.90.0040.02814.65
5.4.80.0080.02514.64
5.4.70.0030.01714.62
5.4.60.0090.02714.64
5.4.50.0040.02414.61
5.4.40.0060.02814.70
5.4.30.0040.02714.64
5.4.20.0030.03114.68
5.4.10.0080.02714.64
5.4.00.0030.02714.45
5.3.290.0020.02214.12
5.3.280.0070.01714.02
5.3.270.0060.01314.09
5.3.260.0030.01914.08
5.3.250.0050.01514.10
5.3.240.0060.01814.09
5.3.230.0050.01514.09
5.3.220.0070.02714.06
5.3.210.0060.03014.11
5.3.200.0090.02014.03
5.3.190.0070.01414.08
5.3.180.0070.02014.11
5.3.170.0020.02114.12
5.3.160.0040.02114.03
5.3.150.0070.01314.08
5.3.140.0040.02114.03
5.3.130.0080.02814.07
5.3.120.0060.02214.06
5.3.110.0090.02414.01
5.3.100.0040.01913.88
5.3.90.0030.02813.88
5.3.80.0010.02413.90
5.3.70.0040.01913.89
5.3.60.0080.02713.88
5.3.50.0030.01813.86
5.3.40.0050.01713.87
5.3.30.0080.02813.84
5.3.20.0050.01613.77
5.3.10.0060.01913.77
5.3.00.0040.01913.69
5.2.170.0070.02711.17
5.2.160.0030.05311.14
5.2.150.0070.06010.98
5.2.140.0030.05311.16
5.2.130.0100.05311.09
5.2.120.0070.05711.02
5.2.110.0030.04011.09
5.2.100.0000.03311.12
5.2.90.0030.05311.02
5.2.80.0000.03711.07
5.2.70.0030.03011.14
5.2.60.0030.05311.04
5.2.50.0100.06011.07
5.2.40.0070.04011.02
5.2.30.0030.06710.95
5.2.20.0070.05711.12
5.2.10.0030.06010.88
5.2.00.0000.03310.75
5.1.60.0070.05010.02
5.1.50.0030.05710.07
5.1.40.0030.0439.91
5.1.30.0030.06010.35
5.1.20.0000.04010.29
5.1.10.0030.05710.00
5.1.00.0070.05010.06
5.0.50.0030.0438.39
5.0.40.0000.0278.39
5.0.30.0000.0638.21
5.0.20.0000.0508.18
5.0.10.0000.0378.25
5.0.00.0030.0378.22
4.4.90.0030.0308.13
4.4.80.0030.0378.13
4.4.70.0070.0308.13
4.4.60.0030.0378.13
4.4.50.0100.0308.13
4.4.40.0000.0378.13
4.4.30.0070.0338.13
4.4.20.0030.0378.13
4.4.10.0000.0238.13
4.4.00.0030.0578.13
4.3.110.0000.0378.13
4.3.100.0100.0208.13
4.3.90.0100.0238.13
4.3.80.0000.0578.13
4.3.70.0000.0378.13
4.3.60.0030.0208.13
4.3.50.0030.0378.13
4.3.40.0000.0478.13
4.3.30.0000.0338.13
4.3.20.0030.0378.13
4.3.10.0000.0408.13
4.3.00.0000.0378.13

preferences:
53.35 ms | 400 KiB | 5 Q