3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_field($soc, $opt) { return "blah-$soc-blah"; } function get_template_directory_uri() { return 'https://example.com'; } $socials = ['facebook', 'twitter', 'instagram']; $templateDirectory = get_template_directory_uri(); foreach ($socials as $social) { $socialHref = trim(get_field($social, 'option')); if (strlen($socialHref)) { $socialLinks[] = sprintf('<a class="social-link ie9" href="%s" target="_blank" rel="noopener"><img src="%s/svg/%s.svg" alt="%s Icon"></a>', $socialHref, $templateDirectory, $social, ucfirst($social) ); } } if (isset($socialLinks)) { echo '<div class="social-media--icons">' , "\n\t" , implode("\n\t", $socialLinks) , "\n" , '</div>'; }

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.4.120.0170.00320.66
8.4.110.0060.00922.63
8.4.100.0090.01117.80
8.4.90.0100.00918.63
8.4.80.0160.00619.52
8.4.70.0110.00917.75
8.4.60.0120.00918.98
8.4.50.0160.00717.58
8.4.40.0090.00918.73
8.4.30.0170.00719.03
8.4.20.0140.01017.69
8.4.10.0130.00618.42
8.3.250.0140.00518.82
8.3.240.0070.00116.84
8.3.230.0140.00616.84
8.3.220.0110.00817.23
8.3.210.0140.00816.76
8.3.200.0060.00316.59
8.3.190.0150.00716.84
8.3.180.0150.00316.51
8.3.170.0170.00716.70
8.3.160.0150.00716.42
8.3.150.0100.01216.77
8.3.140.0140.00716.63
8.3.130.0110.00517.44
8.3.120.0070.00817.65
8.3.110.0110.00518.68
8.3.100.0160.00316.55
8.3.90.0160.00721.71
8.3.80.0140.00417.50
8.3.70.0180.00316.60
8.3.60.0130.00716.62
8.3.50.0130.00421.28
8.3.40.0170.00218.07
8.3.30.0150.00318.10
8.3.20.0110.00519.12
8.3.10.0130.00218.81
8.3.00.0070.00419.96
8.2.290.0100.00820.81
8.2.280.0110.00817.34
8.2.270.0120.00816.91
8.2.260.0110.00817.57
8.2.250.0140.00216.57
8.2.240.0120.00717.55
8.2.230.0110.00519.51
8.2.220.0120.00420.23
8.2.210.0120.00321.57
8.2.200.0100.00516.60
8.2.190.0170.00417.55
8.2.180.0160.00521.23
8.2.170.0170.00519.19
8.2.160.0140.00620.41
8.2.150.0120.00520.87
8.2.140.0070.00821.10
8.2.130.0120.00421.86
8.2.120.0140.00319.26
8.2.110.0150.00118.47
8.2.100.0110.00617.57
8.2.90.0100.00518.70
8.2.80.0090.00618.30
8.2.70.0120.00317.47
8.2.60.0080.00617.70
8.2.50.0060.00518.71
8.2.40.0070.00419.73
8.2.30.0050.00519.32
8.2.20.0040.00618.70
8.2.10.0070.00319.37
8.2.00.0060.00419.23
8.1.330.0100.00922.17
8.1.320.0120.00816.16
8.1.310.0090.00717.13
8.1.300.0120.00317.32
8.1.290.0110.00623.45
8.1.280.0140.00720.97
8.1.270.0100.00519.66
8.1.260.0160.00121.87
8.1.250.0100.00522.67
8.1.240.0120.00420.37
8.1.230.0140.00219.08
8.1.220.0070.00717.59
8.1.210.0090.00517.91
8.1.200.0120.00317.33
8.1.190.0100.00517.13
8.1.180.0130.00317.53
8.1.170.0110.00417.76
8.1.160.0110.00318.13
8.1.150.0110.00318.15
8.1.140.0070.00818.06
8.1.130.0120.00418.87
8.1.120.0120.00317.28
8.1.110.0090.00617.32
8.1.100.0100.00517.16
8.1.90.0090.00517.35
8.1.80.0070.00717.37
8.1.70.0090.00617.30
8.1.60.0090.00717.38
8.1.50.0120.00417.36
8.1.40.0100.00517.53
8.1.30.0080.00717.53
8.1.20.0100.00517.47
8.1.10.0100.00517.47
8.1.00.0070.00717.14
8.0.300.0130.00218.23
8.0.290.0100.00416.70
8.0.280.0070.00617.47
8.0.270.0090.00517.31
8.0.260.0110.00418.32
8.0.250.0110.00416.79
8.0.240.0090.00516.72
8.0.230.0140.00316.78
8.0.220.0100.00416.70
8.0.210.0070.00616.65
8.0.200.0100.00416.69
8.0.190.0080.00616.73
8.0.180.0100.00516.82
8.0.170.0110.00416.92
8.0.160.0140.00316.67
8.0.150.0090.00516.62
8.0.140.0070.01016.69
8.0.130.0090.00515.06
8.0.120.0090.00616.68
8.0.110.0130.00316.80
8.0.100.0100.00516.79
8.0.90.0090.00616.83
8.0.80.0140.00416.72
8.0.70.0100.00416.76
8.0.60.0060.00716.76
8.0.50.0100.00416.65
8.0.30.0150.00416.84
8.0.20.0150.00716.94
8.0.10.0090.00516.93
8.0.00.0120.00816.81
7.4.330.0090.00415.98
7.4.320.0100.00216.47
7.4.300.0090.00416.34
7.4.290.0100.00316.41
7.4.280.0070.00716.58
7.4.270.0100.00316.44
7.4.260.0090.00314.90
7.4.250.0080.00516.41
7.4.240.0050.00616.57
7.4.230.0140.00116.48
7.4.220.0090.00216.60
7.4.210.0110.00516.60
7.4.200.0100.00316.31
7.4.190.0130.00616.56
7.4.180.0170.00316.57
7.4.160.0150.00516.34
7.4.150.0170.00416.52
7.4.140.0170.00416.24
7.4.130.0140.00416.41
7.4.120.0150.00416.60
7.4.110.0140.00616.47
7.4.100.0130.00716.42
7.4.90.0130.00616.41
7.4.80.0210.00717.77
7.4.70.0160.01016.42
7.4.60.0160.01016.42
7.4.50.0110.01016.29
7.4.40.0090.00816.36
7.4.30.0110.00416.28
7.4.20.0130.00416.54
7.4.10.0100.00916.47
7.4.00.0120.00516.29
7.3.330.0080.00415.97
7.3.320.0060.00414.64
7.3.310.0070.00516.30
7.3.300.0100.00216.22
7.3.290.0100.00816.38
7.3.280.0120.00716.24
7.3.270.0150.00416.27
7.3.260.0110.00816.17
7.3.250.0160.00416.25
7.3.240.0120.00816.48
7.3.230.0130.00616.31
7.3.220.0180.00316.16
7.3.210.0140.00516.36
7.3.200.0140.00516.28
7.3.190.0110.00716.18
7.3.180.0110.00716.34
7.3.170.0090.00916.31
7.3.160.0130.00516.34
7.3.150.0190.00216.30
7.3.140.0100.00816.38
7.3.130.0150.00616.36
7.3.120.0130.00616.19
7.3.110.0090.01216.09
7.3.100.0110.00916.38
7.3.90.0100.01016.44
7.3.80.0170.00316.30
7.3.70.0100.00916.38
7.3.60.0160.00416.44
7.3.50.0120.00916.38
7.3.40.0140.00716.40
7.3.30.0120.00816.43
7.3.20.0130.01017.19
7.3.10.0140.00617.11
7.3.00.0150.00617.34
7.2.340.0170.00216.23
7.2.330.0110.00816.49
7.2.320.0170.00416.45
7.2.310.0080.01016.55
7.2.300.0150.00616.24
7.2.290.0140.00716.38
7.2.280.0140.00616.23
7.2.270.0110.00716.55
7.2.260.0130.00916.53
7.2.250.0140.00816.45
7.2.240.0110.00816.40
7.2.230.0100.01116.56
7.2.220.0110.01016.51
7.2.210.0140.00716.53
7.2.200.0140.00716.60
7.2.190.0150.00616.52
7.2.180.0090.01216.45
7.2.170.0140.00616.44
7.2.160.0080.01216.47
7.2.150.0120.00917.36
7.2.140.0100.01217.55
7.2.130.0120.01017.56
7.2.120.0100.00917.49
7.2.110.0130.00717.37
7.2.100.0140.00717.44
7.2.90.0140.00717.48
7.2.80.0110.00717.45
7.2.70.0140.00217.48
7.2.60.0140.00317.47
7.2.50.0120.00517.46
7.2.40.0120.00617.46
7.2.30.0110.00717.55
7.2.20.0180.00617.55
7.2.10.0140.01117.40
7.2.00.0150.00917.63

preferences:
86.79 ms | 403 KiB | 5 Q