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 "\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.0090.00918.39
8.3.50.0160.00522.00
8.3.40.0100.01018.88
8.3.30.0090.00619.27
8.3.20.0070.00320.30
8.3.10.0070.00023.48
8.3.00.0050.00320.82
8.2.180.0180.00318.43
8.2.170.0060.01322.96
8.2.160.0030.01022.07
8.2.150.0060.01024.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00022.10
8.2.110.0030.00622.26
8.2.100.0100.00317.84
8.2.90.0030.00619.40
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0060.00317.80
8.2.50.0030.00618.07
8.2.40.0060.00319.43
8.2.30.0040.00418.21
8.2.20.0040.00417.84
8.2.10.0040.00417.66
8.2.00.0050.00517.75
8.1.280.0040.01125.92
8.1.270.0060.00323.83
8.1.260.0050.00326.35
8.1.250.0060.00928.09
8.1.240.0050.00523.88
8.1.230.0040.00719.01
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0000.00817.41
8.1.180.0080.00018.10
8.1.170.0000.00918.72
8.1.160.0000.00822.09
8.1.150.0040.00418.67
8.1.140.0000.00717.48
8.1.130.0020.00517.86
8.1.120.0000.00817.40
8.1.110.0040.00417.31
8.1.100.0000.00817.48
8.1.90.0030.00617.40
8.1.80.0000.00817.48
8.1.70.0000.00717.48
8.1.60.0040.00417.60
8.1.50.0080.00017.47
8.1.40.0030.00517.45
8.1.30.0040.00417.63
8.1.20.0030.00517.52
8.1.10.0030.00517.63
8.1.00.0000.00717.57
8.0.300.0040.00418.77
8.0.290.0040.00417.30
8.0.280.0030.00318.51
8.0.270.0050.00217.29
8.0.260.0030.00516.77
8.0.250.0040.00417.00
8.0.240.0050.00217.04
8.0.230.0040.00416.93
8.0.220.0000.00716.93
8.0.210.0030.00316.93
8.0.200.0000.00616.99
8.0.190.0040.00416.86
8.0.180.0000.00716.96
8.0.170.0000.00916.95
8.0.160.0000.00716.98
8.0.150.0030.00616.88
8.0.140.0000.00716.93
8.0.130.0060.00013.29
8.0.120.0040.00416.93
8.0.110.0040.00417.00
8.0.100.0040.00416.82
8.0.90.0000.00816.77
8.0.80.0060.00916.87
8.0.70.0040.00416.78
8.0.60.0040.00416.81
8.0.50.0040.00416.91
8.0.30.0090.01017.14
8.0.20.0070.01317.40
8.0.10.0070.00017.12
8.0.00.0060.01216.58
7.4.330.0030.00315.00
7.4.320.0040.00416.66
7.4.300.0000.00716.67
7.4.290.0070.00016.45
7.4.280.0000.00716.39
7.4.270.0030.00316.65
7.4.260.0070.00016.43
7.4.250.0040.00416.60
7.4.240.0050.00216.63
7.4.230.0070.00016.34
7.4.220.0090.01316.59
7.4.210.0020.01216.60
7.4.200.0000.00716.71
7.4.190.0030.00516.80
7.4.160.0120.00416.57
7.4.150.0120.00917.40
7.4.140.0100.00717.86
7.4.130.0140.00716.56
7.4.120.0080.00916.60
7.4.110.0070.01016.36
7.4.100.0150.01216.60
7.4.90.0090.00916.48
7.4.80.0150.00616.63
7.4.70.0090.00916.63
7.4.60.0060.01316.48
7.4.50.0080.00016.27
7.4.40.0070.00722.77
7.4.30.0110.00516.67
7.4.00.0110.00715.01
7.3.330.0030.00313.22
7.3.320.0050.00013.28
7.3.310.0030.00316.28
7.3.300.0070.00016.28
7.3.290.0140.00716.41
7.3.280.0060.01516.38
7.3.270.0110.00717.40
7.3.260.0130.00416.41
7.3.250.0160.00416.40
7.3.240.0140.00316.42
7.3.230.0000.01716.54
7.3.210.0120.00616.58
7.3.200.0090.00919.39
7.3.190.0100.01016.54
7.3.180.0120.00916.60
7.3.170.0110.00516.61
7.3.160.0100.00616.64
7.3.120.0090.00914.97
7.3.110.0070.00914.73
7.3.100.0080.00714.70
7.3.90.0050.00915.05
7.3.80.0020.01114.79
7.3.70.0070.00814.75
7.3.60.0040.00914.79
7.3.50.0130.00214.90
7.3.40.0090.00414.86
7.3.30.0060.00614.86
7.3.20.0070.00616.79
7.3.10.0080.00516.62
7.3.00.0070.00516.70
7.2.330.0130.00616.91
7.2.320.0120.00616.56
7.2.310.0090.00916.45
7.2.300.0030.01416.54
7.2.290.0070.01116.64
7.2.250.0090.01115.09
7.2.240.0110.00815.09
7.2.230.0060.01015.10
7.2.220.0060.00515.12
7.2.210.0050.00915.15
7.2.200.0050.00614.97
7.2.190.0090.00414.98
7.2.180.0050.00715.05
7.2.170.0070.00614.91
7.2.130.0060.00816.95
7.2.120.0070.01016.90
7.2.110.0030.00716.88
7.2.100.0070.00716.94
7.2.90.0030.01017.02
7.2.80.0110.00017.07
7.2.70.0000.01117.01
7.2.60.0030.01016.97
7.2.50.0030.00916.93
7.2.40.0100.00316.78
7.2.30.0090.00316.79
7.2.20.0030.00917.11
7.2.10.0060.00317.00
7.2.00.0050.00918.03
7.1.330.0070.00815.74
7.1.320.0030.00915.66
7.1.310.0050.00815.88
7.1.300.0030.01015.80
7.1.290.0060.00715.79
7.1.280.0100.00415.80
7.1.270.0020.01015.82
7.1.260.0080.00615.83
7.1.250.0070.00715.85
7.1.200.0120.00015.60
7.1.100.0040.00818.31
7.1.70.0240.00317.25
7.1.60.0040.01919.22
7.1.50.0060.01316.77
7.1.00.0070.07322.36
7.0.200.0080.00416.84
7.0.140.0030.07321.95
7.0.60.0100.06320.11
7.0.50.0100.06317.95
7.0.40.0070.07020.24
7.0.30.0230.04720.13
7.0.20.0330.07020.00
7.0.10.0030.05720.09
7.0.00.0130.03720.16
5.6.280.0000.07721.09
5.6.210.0070.07720.63
5.6.200.0000.08718.21
5.6.190.0100.04020.61
5.6.180.0100.04020.48
5.6.170.0100.04720.50
5.6.160.0100.08020.46
5.6.150.0130.07318.18
5.6.140.0070.03718.18
5.6.130.0100.07718.14
5.6.120.0030.04721.04
5.6.110.0130.08021.03
5.6.100.0070.06021.15
5.6.90.0100.06321.14
5.6.80.0130.07020.42
5.5.350.3830.04320.42
5.5.340.0030.07718.01
5.5.330.0030.06320.46
5.5.320.0530.04320.23
5.5.310.0330.05720.21
5.5.300.0070.07717.92
5.5.290.0070.05017.98
5.5.280.0170.07020.78
5.5.270.0100.08020.89
5.5.260.0030.05720.81
5.5.250.0130.06320.70
5.5.240.0100.08320.28
5.4.450.3400.04019.39
5.4.440.3630.04019.41
5.4.430.3370.03319.45
5.4.420.3430.04019.42
5.4.410.3600.03719.29
5.4.400.3430.03719.25
5.4.390.3500.03719.10
5.4.380.3100.04019.09
5.4.370.3600.03719.24
5.4.360.3400.03719.06
5.4.350.3470.04018.93
5.4.340.3300.03719.04
5.4.320.3330.03318.79
5.4.310.3330.04018.95
5.4.300.3370.03719.08
5.4.290.3370.03318.79
5.4.280.3370.03319.09
5.4.270.3330.03719.24
5.4.260.3670.02718.80
5.4.250.3200.04019.07
5.4.240.2830.04719.09
5.4.230.3700.03718.93
5.4.220.3330.03719.15
5.4.210.3500.04019.23
5.4.200.3430.03318.80
5.4.190.3300.04319.12
5.4.180.3570.03719.23
5.4.170.3700.04019.13
5.4.160.3530.04019.18
5.4.150.3430.03719.23
5.4.140.0730.05316.29
5.4.130.0070.03316.25
5.4.120.3100.03016.54
5.4.110.3430.03716.22
5.4.100.3630.03316.21
5.4.90.3300.03016.44
5.4.80.3030.04016.20
5.4.70.3130.03316.44
5.4.60.4170.03316.48
5.4.50.3770.03716.36
5.4.40.3400.03716.40
5.4.30.3700.03016.40
5.4.20.1330.02316.37
5.4.10.0030.03316.36
5.4.00.0630.03015.88
5.3.290.3430.04714.78
5.3.280.3500.04014.49
5.3.270.3930.04014.72
5.3.260.3470.03314.54
5.3.250.3570.04014.50
5.3.240.0100.03714.58
5.3.230.0930.04714.46
5.3.220.3730.03314.43
5.3.210.3430.02714.62
5.3.200.3470.03014.53
5.3.190.3500.03714.54
5.3.180.3500.03714.46
5.3.170.3530.03314.44
5.3.160.3400.04014.50
5.3.150.3430.04014.45
5.3.140.3400.04014.44
5.3.130.3400.03714.60
5.3.120.3130.03714.43
5.3.110.0000.04014.43
5.3.100.3630.04713.92
5.3.90.3170.03313.99
5.3.80.3130.03714.09
5.3.70.3400.03713.84
5.3.60.3370.03713.94
5.3.50.3670.03713.94
5.3.40.3500.03314.06
5.3.30.3570.04313.96
5.3.20.3530.03313.52
5.3.10.3570.04013.46
5.3.00.3570.04013.75
5.2.170.2800.02711.23
5.2.160.2370.03311.04
5.2.150.3030.03011.01
5.2.140.2900.03011.06
5.2.130.2970.03011.18
5.2.120.2970.03311.15
5.2.110.3000.03310.99
5.2.100.2870.03311.07
5.2.90.2930.03010.97
5.2.80.2930.02710.98
5.2.70.2970.03711.14
5.2.60.2770.02711.09
5.2.50.3000.03010.93
5.2.40.2500.03011.11
5.2.30.2530.03311.00
5.2.20.2330.02710.86
5.2.10.2270.02010.99
5.2.00.2400.02310.64
5.1.60.2230.02310.06
5.1.50.2270.01710.13
5.1.40.2130.0309.89
5.1.30.2300.02710.25
5.1.20.2270.02010.59
5.1.10.2270.0239.98
5.1.00.2300.02710.02
5.0.50.1200.0239.29
5.0.40.1070.0209.29
5.0.30.1200.0309.29
5.0.20.1270.0179.29
5.0.10.1070.0239.29
5.0.00.1130.0279.29
4.4.90.1100.0179.29
4.4.80.1200.0179.29
4.4.70.1170.0139.29
4.4.60.1130.0179.29
4.4.50.1070.0209.29
4.4.40.0670.0279.29
4.4.30.1070.0179.29
4.4.20.1100.0179.29
4.4.10.1130.0179.29
4.4.00.1070.0279.29
4.3.110.1130.0179.29
4.3.100.1330.0209.29
4.3.90.1100.0139.29
4.3.80.1130.0239.29
4.3.70.1170.0139.29
4.3.60.1330.0139.29
4.3.50.1170.0179.29
4.3.40.1200.0239.29
4.3.30.0700.0279.29
4.3.20.0630.0179.29
4.3.10.0570.0179.29
4.3.00.0570.0179.29

preferences:
40.44 ms | 401 KiB | 5 Q