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.3.70.0120.00316.75
8.3.60.0080.00816.63
8.3.50.0110.00316.55
8.3.40.0120.00318.66
8.3.30.0140.00018.63
8.3.20.0040.00420.65
8.3.10.0080.00020.34
8.3.00.0080.00020.89
8.2.190.0170.00318.41
8.2.180.0140.00425.92
8.2.170.0170.00318.91
8.2.160.0100.00722.96
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00020.89
8.2.110.0090.00019.36
8.2.100.0040.00717.71
8.2.90.0040.00420.07
8.2.80.0000.00819.20
8.2.70.0050.00317.50
8.2.60.0030.00717.93
8.2.50.0040.00418.07
8.2.40.0050.00320.07
8.2.30.0050.00219.52
8.2.20.0040.00418.20
8.2.10.0040.00419.30
8.2.00.0040.00419.24
8.1.280.0140.00725.92
8.1.270.0040.00422.11
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00323.73
8.1.230.0110.00020.96
8.1.220.0000.00817.79
8.1.210.0000.00818.79
8.1.200.0090.00017.36
8.1.190.0030.00517.13
8.1.180.0060.00318.10
8.1.170.0040.00418.45
8.1.160.0070.00019.09
8.1.150.0040.00418.92
8.1.140.0000.00718.91
8.1.130.0060.00320.28
8.1.120.0080.00317.46
8.1.110.0000.00717.50
8.1.100.0050.00317.38
8.1.90.0040.00417.51
8.1.80.0000.00717.38
8.1.70.0030.00317.46
8.1.60.0030.00517.53
8.1.50.0040.00417.57
8.1.40.0050.00317.48
8.1.30.0030.00517.58
8.1.20.0030.00517.73
8.1.10.0040.00417.43
8.1.00.0000.00717.41
8.0.300.0080.00020.02
8.0.290.0080.00016.88
8.0.280.0030.00318.36
8.0.270.0040.00418.06
8.0.260.0050.00220.10
8.0.250.0080.00017.04
8.0.240.0040.00417.01
8.0.230.0090.00016.95
8.0.220.0040.00416.94
8.0.210.0000.00716.83
8.0.200.0040.00416.88
8.0.190.0000.00717.02
8.0.180.0040.00416.98
8.0.170.0060.00316.93
8.0.160.0090.00017.02
8.0.150.0020.00516.78
8.0.140.0040.00916.84
8.0.130.0030.00313.31
8.0.120.0000.00716.80
8.0.110.0100.00017.05
8.0.100.0030.00316.88
8.0.90.0000.00916.95
8.0.80.0120.00416.94
8.0.70.0040.00416.88
8.0.60.0000.00716.89
8.0.50.0020.00516.74
8.0.30.0100.00716.96
8.0.20.0120.00917.21
8.0.10.0040.00417.12
8.0.00.0070.01116.87
7.4.330.0030.00315.55
7.4.320.0060.00016.53
7.4.300.0050.00216.40
7.4.290.0030.00316.54
7.4.280.0000.00816.63
7.4.270.0030.00316.46
7.4.260.0030.00313.42
7.4.250.0030.00316.48
7.4.240.0000.00716.66
7.4.230.0070.00016.61
7.4.220.0050.00216.69
7.4.210.0080.00616.67
7.4.200.0040.00416.38
7.4.130.0140.00416.50
7.4.120.0130.00616.67
7.4.110.0150.00916.68
7.4.100.0140.01016.34
7.4.90.0080.00816.48
7.4.80.0200.00519.39
7.4.70.0030.01316.54
7.4.60.0040.01416.45
7.4.50.0000.01616.47
7.4.40.0060.01116.36
7.4.20.0130.00416.60
7.4.10.0070.01516.54
7.4.00.0110.00616.42
7.3.330.0050.00216.28
7.3.320.0000.00613.35
7.3.310.0000.00816.35
7.3.300.0070.00016.40
7.3.290.0090.00916.46
7.3.280.0100.01016.44
7.3.260.0080.01216.41
7.3.240.0110.00916.53
7.3.230.0100.00716.29
7.3.210.0090.00916.73
7.3.200.0100.00616.39
7.3.190.0030.01216.29
7.3.180.0080.00816.42
7.3.170.0030.01416.64
7.3.160.0090.00616.48
7.3.140.0030.01216.47
7.3.130.0160.00616.47
7.3.120.0140.00716.53
7.3.110.0040.01916.27
7.3.100.0060.01616.54
7.3.90.0070.01416.39
7.3.80.0180.00316.51
7.3.70.0070.01416.40
7.3.60.0150.00716.45
7.3.50.0130.00916.43
7.3.40.0150.00916.45
7.3.30.0120.00916.42
7.3.20.0100.01316.33
7.3.10.0150.00916.37
7.3.00.0120.00916.49
7.2.330.0090.00916.73
7.2.320.0170.00716.81
7.2.310.0030.01316.71
7.2.300.0120.00916.43
7.2.290.0120.00916.38
7.2.270.0060.00916.76
7.2.260.0120.01216.66
7.2.250.0130.01016.59
7.2.240.0100.01316.61
7.2.230.0060.01616.71
7.2.220.0090.01316.56
7.2.210.0110.01116.78
7.2.200.0150.00916.70
7.2.190.0150.00816.71
7.2.180.0030.02016.73
7.2.170.0120.00916.68
7.2.160.0060.01616.63
7.2.150.0100.01416.65
7.2.140.0070.01616.80
7.2.130.0090.01216.78
7.2.120.0040.01416.68
7.2.110.0130.01016.86
7.2.100.0100.01416.66
7.2.90.0120.01216.74
7.2.80.0110.00716.60
7.2.70.0160.00016.71
7.2.60.0130.00316.80
7.2.50.0130.00316.70
7.2.40.0110.00516.65
7.2.30.0060.00916.70
7.2.20.0140.00316.66
7.2.10.0040.01216.60
7.2.00.0040.01216.71

preferences:
58.94 ms | 401 KiB | 5 Q