3v4l.org

run code in 300+ PHP versions simultaneously
<?php $notifications = [ ['score'=>120,'type'=>5,'post_id'=>1,'subject'=>'a subject','range_day'=>'today'], ['score'=>6,'type'=>4,'post_id'=>2,'subject'=>'a subject','range_day'=>'today'], ['score'=>2,'type'=>4,'post_id'=>3,'subject'=>'a subject','range_day'=>'yesterday'], ]; $template = <<< 'TXT' <li> <p class="subject">{{subject}}<span> | type:{{type}}</span></p> <div class="score">Your score: {{score}}</div> <a href="/{{post_id}}/{{no_space_subject}}"> <span class="date">{{range_day}}</span> </li> TXT; $links = ''; foreach ($notifications as $n){ $n['no_space_subject'] = str_replace(' ','-',$n['subject']); //replace {{VALUE}} with $n[VALUE] in the template. append result //to $links $links .= preg_replace_callback('/{{([^}]+)}}/s', function($m) use ($n){return $n[$m[1]];}, $template ); } echo "<u>$links</u>";

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.0060.00916.63
8.3.50.0090.00922.96
8.3.40.0090.00619.07
8.3.30.0150.00018.78
8.3.20.0030.00521.92
8.3.10.0040.00421.65
8.3.00.0080.00019.97
8.2.180.0060.01018.54
8.2.170.0120.00322.96
8.2.160.0120.00422.25
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00621.20
8.2.110.0000.01021.06
8.2.100.0090.00317.97
8.2.90.0050.00318.16
8.2.80.0030.00617.97
8.2.70.0060.00317.75
8.2.60.0000.00818.04
8.2.50.0080.00018.10
8.2.40.0060.00322.30
8.2.30.0050.00219.35
8.2.20.0040.00417.81
8.2.10.0040.00418.21
8.2.00.0040.00418.03
8.1.280.0100.00725.92
8.1.270.0080.00023.92
8.1.260.0080.00026.35
8.1.250.0000.00928.09
8.1.240.0090.00023.85
8.1.230.0080.00421.10
8.1.220.0080.00017.79
8.1.210.0000.00818.84
8.1.200.0060.00317.35
8.1.190.0000.00817.38
8.1.180.0000.00818.10
8.1.170.0060.00318.69
8.1.160.0000.00722.08
8.1.150.0050.00222.69
8.1.140.0040.00419.64
8.1.130.0030.00417.64
8.1.120.0040.00417.53
8.1.110.0040.00417.55
8.1.100.0000.00717.54
8.1.90.0040.00417.65
8.1.80.0020.00517.62
8.1.70.0000.00717.64
8.1.60.0030.00517.73
8.1.50.0060.00317.56
8.1.40.0030.00617.75
8.1.30.0030.00617.88
8.1.20.0060.00317.81
8.1.10.0040.00417.70
8.1.00.0000.00817.65
8.0.300.0040.00419.96
8.0.290.0080.00016.75
8.0.280.0050.00318.47
8.0.270.0000.00717.04
8.0.260.0030.00317.21
8.0.250.0030.00417.17
8.0.240.0040.00417.15
8.0.230.0030.00317.21
8.0.220.0000.00817.15
8.0.210.0030.00317.09
8.0.200.0060.00017.19
8.0.190.0040.00417.21
8.0.180.0040.00417.03
8.0.170.0050.00316.97
8.0.160.0000.00717.09
8.0.150.0070.00016.98
8.0.140.0040.00416.95
8.0.130.0030.00313.44
8.0.120.0060.00316.96
8.0.110.0040.00417.00
8.0.100.0070.00016.95
8.0.90.0040.00416.89
8.0.80.0070.00717.13
8.0.70.0040.00417.02
8.0.60.0000.00817.09
8.0.50.0040.00417.17
8.0.30.0100.00817.22
8.0.20.0100.01117.50
8.0.10.0000.00717.03
8.0.00.0060.01116.74
7.4.330.0050.00015.13
7.4.320.0030.00316.71
7.4.300.0040.00416.71
7.4.290.0050.00316.81
7.4.280.0000.00916.85
7.4.270.0090.00016.83
7.4.260.0070.00516.71
7.4.250.0030.00516.68
7.4.240.0000.00816.83
7.4.230.0050.00316.89
7.4.220.0160.01016.76
7.4.210.0080.00716.80
7.4.200.0040.00416.91
7.4.160.0120.00316.77
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0060.01116.72
7.4.120.0060.01216.66
7.4.110.0180.00916.80
7.4.100.0160.00616.70
7.4.90.0030.01516.84
7.4.80.0150.00719.39
7.4.70.0130.00316.73
7.4.60.0060.01016.85
7.4.50.0060.00916.70
7.4.40.0160.00016.70
7.4.30.0070.01116.76
7.4.00.0040.01115.17
7.3.330.0030.00313.50
7.3.320.0060.00013.53
7.3.310.0000.00716.40
7.3.300.0050.00216.55
7.3.290.0080.00016.59
7.3.280.0090.00816.57
7.3.270.0130.00317.40
7.3.260.0080.01016.61
7.3.250.0090.01116.70
7.3.240.0100.01116.64
7.3.230.0110.01116.78
7.3.210.0000.01716.85
7.3.200.0070.01016.86
7.3.190.0090.00816.56
7.3.180.0040.01816.89
7.3.170.0070.01516.91
7.3.160.0070.01016.67
7.2.330.0060.01216.82
7.2.320.0110.00716.96
7.2.310.0100.00716.91
7.2.300.0030.01416.93
7.2.290.0090.00816.78
7.2.60.0060.01017.04
7.1.200.0070.00715.92
7.1.70.0050.00517.41
7.1.60.0060.00619.75
7.1.00.0070.07022.33
7.0.200.0280.00415.09
7.0.90.0300.06020.20
7.0.80.0070.05719.89
7.0.70.0100.06019.88
7.0.60.0270.06319.97
7.0.50.0130.05720.20
7.0.40.0170.05320.36
7.0.30.0100.06320.30
7.0.20.0130.06720.33
7.0.10.1100.06020.36
7.0.00.0330.06320.32
5.6.240.0230.06020.72
5.6.230.0230.05720.61
5.6.220.0170.05320.70
5.6.210.0200.04720.72
5.6.200.0130.06021.06
5.6.190.0130.06021.12
5.6.180.0100.06321.13
5.6.170.0070.06721.02
5.6.160.0170.07721.08
5.6.150.0230.05021.07
5.6.140.0200.07321.03
5.6.130.0130.06321.02
5.6.120.0230.06721.09
5.6.110.0130.06021.01
5.6.100.0070.07321.10
5.6.90.0100.06321.04
5.6.80.0070.06320.50
5.6.70.0100.05720.39
5.6.60.0300.06020.44
5.6.50.0100.06320.49
5.6.40.0230.06720.39
5.6.30.0130.07720.43
5.6.20.0100.06320.48
5.6.10.0030.07020.46
5.6.00.0200.05020.35

preferences:
59.57 ms | 401 KiB | 5 Q