3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<!--HEAD--><p class="listing-grp-title">Top Ranked Offers</p><!--HEAD--> <!--WRAPPERSTART--><div><table><!--WRAPPERSTART--> <tr class="{% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}"> <td class="rank">&#35; {{forloop.counter}}</td> <td class="logo"> <img src="{{ad.display_url}}" width="120" height="40" alt="Aig Sml"/> </td> <td> <p class="offer">{{ad.headline}}</p> {{ad.body|safe}} </td> <td> <img src="images/arrow.png" width="14" height="18" alt=""/> </td> <td class="end"> <a href="#"><img class="button" src="images/sml-btn.png" width="112" height="30" alt=""/></a> </td> </tr> <!--WRAPPEREND--></table></div><!--WRAPPEREND-->'; $sub= 'sub_0_'; echo _format_special_tags($html,$sub); function _format_special_tags($html,$sub) { //where sub is sub_1_ or similar $tags = array(); $outer= "{% if forloop.counter = ".$sub."range.0 %}"; $end_outer = "{% endif %}"; $header = _return_between('<!--HEAD-->',$html); $wrapper_start = _return_between('<!--WRAPPERSTART-->',$html); $wrapper_end = _return_between('<!--WRAPPEREND-->',$html); $html = $outer.(($header)?$header:'').(($wrapper_start)?$wrapper_start:'').$end_outer.$html.$outer.(($wrapper_end)?$wrapper_end:'').$end_outer; return $html; } function _return_between($tag,$subject) { $split = explode($tag,$subject,3); return (isset($split[1]))?$split[1]:false; } function _remove_between($tag,$subject) { echo preg_replace("/".$tag.".+?".$tag."/i", "", $subject); }

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.70.0070.01018.30
8.3.60.0080.00816.25
8.3.50.0210.00722.12
8.3.40.0170.00018.71
8.3.30.0080.00819.08
8.3.20.0050.00320.16
8.3.10.0080.00023.58
8.3.00.0090.00019.38
8.2.180.0080.00818.41
8.2.170.0140.00022.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0100.00726.16
8.2.120.0070.00022.08
8.2.110.0030.00721.00
8.2.100.0000.01117.97
8.2.90.0030.00619.17
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0030.00618.05
8.2.50.0030.00618.10
8.2.40.0050.00320.59
8.2.30.0000.00719.94
8.2.20.0040.00417.78
8.2.10.0040.00418.04
8.2.00.0030.00817.77
8.1.280.0040.01125.92
8.1.270.0060.00323.77
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0030.00621.03
8.1.230.0070.00420.35
8.1.220.0040.00417.80
8.1.210.0050.00318.77
8.1.200.0000.01017.38
8.1.190.0040.00417.10
8.1.180.0030.00518.10
8.1.170.0060.00318.59
8.1.160.0000.00822.12
8.1.150.0050.00318.69
8.1.140.0090.00017.50
8.1.130.0030.00317.75
8.1.120.0000.00817.43
8.1.110.0040.00417.57
8.1.100.0000.00917.59
8.1.90.0000.00717.42
8.1.80.0070.00017.40
8.1.70.0000.00717.43
8.1.60.0090.00017.65
8.1.50.0000.00817.41
8.1.40.0040.00417.54
8.1.30.0030.00517.71
8.1.20.0000.00817.54
8.1.10.0000.00817.63
8.1.00.0040.00417.52
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0030.00318.46
8.0.270.0000.00817.38
8.0.260.0030.00317.22
8.0.250.0030.00316.91
8.0.240.0040.00416.98
8.0.230.0000.00716.89
8.0.220.0000.00716.87
8.0.210.0030.00516.93
8.0.200.0070.00016.93
8.0.190.0060.00316.94
8.0.180.0050.00317.00
8.0.170.0040.00416.96
8.0.160.0070.00016.95
8.0.150.0070.00016.87
8.0.140.0040.00416.89
8.0.130.0000.00513.37
8.0.120.0040.00416.80
8.0.110.0000.00716.86
8.0.100.0030.00516.84
8.0.90.0060.00316.98
8.0.80.0110.00316.91
8.0.70.0040.00417.01
8.0.60.0040.00416.81
8.0.50.0070.00016.93
8.0.30.0080.01217.12
8.0.20.0090.00917.40
8.0.10.0050.00316.84
8.0.00.0110.01016.96
7.4.330.0050.00015.12
7.4.320.0000.00616.66
7.4.300.0060.00016.57
7.4.290.0000.00716.54
7.4.280.0100.00016.68
7.4.270.0040.00416.67
7.4.260.0000.00816.53
7.4.250.0000.00816.47
7.4.240.0040.00316.52
7.4.230.0000.00716.66
7.4.220.0060.01316.63
7.4.210.0120.00616.72
7.4.200.0040.00316.36
7.4.190.0000.00716.42
7.4.160.0130.00416.52
7.4.150.0080.01117.40
7.4.140.0080.01117.86
7.4.130.0080.00916.57
7.4.120.0050.01316.65
7.4.110.0100.00716.45
7.4.100.0140.00516.52
7.4.90.0100.00716.64
7.4.80.0120.01619.39
7.4.70.0040.01416.46
7.4.60.0110.00816.57
7.4.50.0020.00216.58
7.4.40.0120.00322.77
7.4.30.0090.00616.71
7.4.00.0060.01214.72
7.3.330.0060.00013.35
7.3.320.0000.00513.43
7.3.310.0050.00216.37
7.3.300.0030.00316.28
7.3.290.0090.00616.34
7.3.280.0130.00616.29
7.3.270.0140.00317.40
7.3.260.0140.00416.54
7.3.250.0110.01016.42
7.3.240.0060.00916.53
7.3.230.0090.00916.43
7.3.210.0100.01016.41
7.3.200.0110.01219.39
7.3.190.0110.01116.63
7.3.180.0160.00016.31
7.3.170.0090.00616.54
7.3.160.0070.01016.39
7.3.120.0000.01614.85
7.3.10.0080.00716.53
7.3.00.0160.00716.55
7.2.330.0080.01116.94
7.2.320.0070.01016.83
7.2.310.0000.01816.42
7.2.300.0000.01616.65
7.2.290.0060.00916.62
7.2.130.0040.01016.56
7.2.120.0050.01216.76
7.2.110.0130.00616.68
7.2.100.0100.00816.90
7.2.90.0040.01216.66
7.2.80.0110.00516.82
7.2.70.0210.00716.86
7.2.60.0080.00816.74
7.2.50.0260.00916.72
7.2.40.0150.00816.95
7.2.30.0150.00916.73
7.2.20.0240.00516.79
7.2.10.0140.00816.89
7.2.00.0120.00516.93
7.1.250.0080.00915.57
7.1.70.0040.01117.29
7.1.60.0070.00716.95
7.1.50.0180.01116.89
7.1.00.0030.07722.51
7.0.200.0040.01116.52
7.0.140.0070.06721.95
7.0.60.0100.04319.99
7.0.50.0070.08317.95
7.0.40.0100.06720.26
7.0.30.0130.08020.16
7.0.20.0200.04720.11
7.0.10.0070.08720.09
7.0.00.0100.04020.10
5.6.280.0030.09020.91
5.6.210.0070.08320.71
5.6.200.0200.07018.15
5.6.190.0100.05720.41
5.6.180.0170.07320.64
5.6.170.0300.07020.49
5.6.160.0100.03720.48
5.6.150.0100.08318.25
5.6.140.0170.07018.23
5.6.130.0100.05718.16
5.6.120.0070.04321.03
5.6.110.0070.08720.97
5.6.100.0100.08021.00
5.6.90.0130.07721.07
5.6.80.0100.04020.52
5.5.350.0230.07020.36
5.5.340.0100.04718.04
5.5.330.0070.05320.21
5.5.320.0070.06320.35
5.5.310.0230.08020.30
5.5.300.0000.04318.01
5.5.290.0030.04017.98
5.5.280.0100.04720.69
5.5.270.0070.07720.76
5.5.260.0030.04320.65
5.5.250.0070.07020.59
5.5.240.0270.07320.30
5.4.450.0670.06319.61
5.4.440.0900.07719.59
5.4.430.0630.06019.63
5.4.420.0170.05319.21
5.4.410.0730.05319.47
5.4.400.0700.05319.14
5.4.390.0730.06718.84
5.4.380.0400.04718.73
5.4.370.0270.05718.54
5.4.360.0330.05318.79
5.4.350.0170.06718.50
5.4.340.0270.05718.73
5.4.320.0050.03912.51
5.4.310.0080.03512.51
5.4.300.0060.04212.51
5.4.290.0050.04012.50
5.4.280.0060.03612.39
5.4.270.0060.03412.39
5.4.260.0050.03812.39
5.4.250.0070.03512.39
5.4.240.0060.04012.39
5.4.230.0050.03712.39
5.4.220.0030.03812.38
5.4.210.0020.03912.39
5.4.200.0090.03312.38
5.4.190.0040.03712.38
5.4.180.0030.03812.38
5.4.170.0070.03412.39
5.4.160.0090.03412.38
5.4.150.0060.03812.38
5.4.140.0040.03812.07
5.4.130.0020.03812.05
5.4.120.0080.03312.01
5.4.110.0040.03712.01
5.4.100.0080.03812.00
5.4.90.0020.04612.00
5.4.80.0060.03512.01
5.4.70.0030.03812.00
5.4.60.0050.03912.00
5.4.50.0040.03612.00
5.4.40.0030.03611.99
5.4.30.0040.03711.99
5.4.20.0030.03711.98
5.4.10.0040.03811.99
5.4.00.0070.03611.48
5.3.290.0100.03812.80
5.3.280.0070.04312.71
5.3.270.0080.03912.73
5.3.260.0040.04012.72
5.3.250.0080.03512.72
5.3.240.0020.04112.72
5.3.230.0080.03712.71
5.3.220.0040.03912.68
5.3.210.0090.03512.68
5.3.200.0060.04312.68
5.3.190.0090.03912.68
5.3.180.0050.04112.67
5.3.170.0060.04012.67
5.3.160.0040.03812.67
5.3.150.0040.04212.67
5.3.140.0040.03712.66
5.3.130.0040.04112.66
5.3.120.0080.05112.66
5.3.110.0100.04812.65
5.3.100.0080.03512.13
5.3.90.0080.04912.11
5.3.80.0040.04212.10
5.3.70.0070.03712.10
5.3.60.0080.04112.08
5.3.50.0070.03612.03
5.3.40.0080.04112.04
5.3.30.0070.03512.00
5.3.20.0090.03611.77
5.3.10.0070.03511.73
5.3.00.0060.03811.73
5.2.170.0060.0309.24
5.2.160.0060.0339.24
5.2.150.0030.0349.23
5.2.140.0030.0329.23
5.2.130.0030.0329.20
5.2.120.0100.0309.20
5.2.110.0030.0349.19
5.2.100.0040.0329.19
5.2.90.0060.0309.19
5.2.80.0060.0389.18
5.2.70.0080.0309.18
5.2.60.0040.0319.14
5.2.50.0060.0319.11
5.2.40.0040.0419.09
5.2.30.0050.0319.06
5.2.20.0090.0369.05
5.2.10.0050.0318.96
5.2.00.0050.0308.82
5.1.60.0070.0318.11
5.1.50.0020.0288.10
5.1.40.0050.0258.07
5.1.30.0060.0278.42
5.1.20.0060.0328.45
5.1.10.0040.0288.18
5.1.00.0020.0318.18
5.0.50.0030.0236.67
5.0.40.0020.0236.52
5.0.30.0050.0326.34
5.0.20.0040.0196.30
5.0.10.0040.0206.29
5.0.00.0050.0836.27
4.4.90.0040.0214.78
4.4.80.0030.0224.76
4.4.70.0030.0194.75
4.4.60.0020.0174.75
4.4.50.0030.0154.77
4.4.40.0020.0304.71
4.4.30.0030.0164.76
4.4.20.0030.0174.84
4.4.10.0020.0214.84
4.4.00.0050.0284.76
4.3.110.0030.0194.67
4.3.100.0030.0194.66
4.3.90.0020.0184.63
4.3.80.0040.0284.59
4.3.70.0060.0184.63
4.3.60.0070.0154.63
4.3.50.0030.0224.63
4.3.40.0030.0314.54
4.3.30.0020.0183.33
4.3.20.0020.0163.30
4.3.10.0060.0233.27
4.3.00.0170.03310.54

preferences:
48.83 ms | 404 KiB | 6 Q