3v4l.org

run code in 300+ PHP versions simultaneously
<html> <body> <?php $images = array( array('img' => 'image1.jpg', 'url' => 'http://example1.com', 'div' => 'class="d1"'), array('img' => 'image2.jpg', 'url' => 'http://example2.com', 'div' => 'class="d2"'), array('img' => 'image3.jpg', 'url' => 'http://example3.com', 'div' => 'class="d3"'), array('img' => 'image4.jpg', 'url' => 'http://example4.com', 'div' => 'class="d4"'), array('img' => 'image5.jpg', 'url' => 'http://example5.com', 'div' => 'class="d5"'), array('img' => 'image6.jpg', 'url' => 'http://example6.com', 'div' => 'class="d6"') ); // Selects 3 random array values and returns the key for each value $randomkeys = array_rand($images, 3); // Here we loop through the given index keys from the $images array. // For each key we will then get the value from $images with the index $key foreach ($randomkeys as $key) { // I end with PHP_EOL (End of line) so the source code will look a bit prettier. echo '<div class="1">' . PHP_EOL . '<a href="' . $images[$key]['url'] . '">' . PHP_EOL . '<div ' . $images[$key]['div'] . '>' . PHP_EOL . '<img src="' . $images[$key]['img'] . '">' . PHP_EOL . '</div>' . PHP_EOL . '</a></div>' . PHP_EOL; } ?> </body> </html>

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)
7.4.00.0090.00614.77
7.3.120.0030.01314.86
7.3.110.0140.00414.84
7.3.100.0030.01214.55
7.3.90.0060.01215.11
7.3.80.0060.00914.79
7.3.70.0070.00614.91
7.3.60.0040.01214.70
7.3.50.0080.00814.71
7.3.40.0030.00614.85
7.3.30.0080.00814.76
7.3.20.0000.01716.46
7.3.10.0060.00916.76
7.3.00.0070.01116.80
7.2.250.0070.01114.99
7.2.240.0070.01315.29
7.2.230.0100.00614.89
7.2.220.0090.00615.32
7.2.210.0040.01514.95
7.2.200.0070.01015.23
7.2.190.0100.00014.86
7.2.180.0110.00415.16
7.2.170.0000.01015.09
7.2.00.0090.00619.60
7.1.330.0100.00715.76
7.1.320.0070.01015.87
7.1.310.0000.01516.03
7.1.300.0000.01315.86
7.1.290.0000.01415.91
7.1.280.0030.00915.77
7.1.270.0080.00815.60
7.1.260.0000.01015.97
7.1.70.0040.00417.21
7.1.60.0000.02419.12
7.1.50.0150.01116.86
7.1.00.0030.07722.55
7.0.200.0320.00314.39
7.0.60.0030.09319.98
7.0.50.0130.07017.88
7.0.40.0100.08320.01
7.0.30.0230.06320.32
7.0.20.0300.07720.16
7.0.10.0030.04320.21
7.0.00.0000.06020.18
5.6.280.0030.05321.12
5.6.210.0130.07320.50
5.6.200.0000.06018.18
5.6.190.0170.08020.67
5.6.180.0300.05020.77
5.6.170.0230.08020.35
5.6.160.0100.07320.50
5.6.150.0100.05018.21
5.6.140.0100.03718.11
5.6.130.0100.07318.14
5.6.120.0100.08021.05
5.6.110.0030.04721.03
5.6.100.0170.04321.01
5.6.90.0100.07721.02
5.6.80.0130.05320.41
5.5.350.4100.04320.35
5.5.340.0100.05718.02
5.5.330.0070.07320.43
5.5.320.0370.07020.21
5.5.310.0270.06320.07
5.5.300.0000.08017.93
5.5.290.0100.07718.02
5.5.280.0030.08320.85
5.5.270.0030.08020.75
5.5.260.0130.08020.75
5.5.250.0070.03720.62
5.5.240.0030.07320.26
5.4.450.0630.06019.40
5.4.440.0670.07019.47
5.4.430.0870.07319.43
5.4.420.0870.07019.21
5.4.410.0730.06019.24
5.4.400.0600.05719.20
5.4.390.0730.06019.16
5.4.380.0700.05319.04
5.4.370.0600.06319.16
5.4.360.0500.06719.11
5.4.350.0570.06319.22
5.4.340.0700.05318.80
5.4.320.0770.05718.78
5.4.310.0600.06319.28
5.4.300.0600.05719.21
5.4.290.0630.05018.88
5.4.280.0670.07719.08
5.4.270.0700.04718.88
5.4.260.0770.06019.25
5.4.250.0600.06018.94
5.4.240.0600.05718.94
5.4.230.0570.06719.19
5.4.220.0600.05319.30
5.4.210.0670.07018.91
5.4.200.0530.06016.71
5.4.190.0470.06318.82
5.4.180.0770.07318.93
5.4.170.0900.07019.15
5.4.160.0830.05019.06
5.4.150.0730.06018.91
5.4.140.0670.05316.45
5.4.130.1000.04016.39
5.4.120.0770.04716.38
5.4.110.0770.05316.32
5.4.100.0930.05716.46
5.4.90.0800.04316.38
5.4.80.0730.04716.26
5.4.70.0730.05716.34
5.4.60.0770.04316.40
5.4.50.0930.06016.36
5.4.40.0570.06016.22
5.4.30.0830.04716.30
5.4.20.0670.05316.46
5.4.10.0770.05316.30
5.4.00.0730.05315.67
5.3.290.0700.05714.69
5.3.280.0730.05014.45
5.3.270.0700.06014.55
5.3.260.0800.04314.45
5.3.250.0830.05314.45
5.3.240.0630.05714.46
5.3.230.0730.05314.56
5.3.220.0770.04314.52
5.3.210.0570.06014.55
5.3.200.0570.05314.59
5.3.190.0630.05014.41
5.3.180.0500.05314.41
5.3.170.0630.05314.41
5.3.160.0700.05314.55
5.3.150.0670.06314.41
5.3.140.0970.06014.43
5.3.130.0900.06314.44
5.3.120.0700.07314.39
5.3.110.0870.05014.43
5.3.100.0630.06013.88
5.3.90.0670.05713.97
5.3.80.0800.03713.98
5.3.70.0730.05014.04
5.3.60.0730.04713.98
5.3.50.0770.05313.74
5.3.40.0900.04314.04
5.3.30.0700.04713.79
5.3.20.0730.05013.54
5.3.10.0570.06013.75
5.3.00.0700.05313.48
5.2.170.0700.04311.10
5.2.160.0530.03711.02
5.2.150.0570.05311.00
5.2.140.0670.04011.10
5.2.130.0730.03310.93
5.2.120.0670.03710.95
5.2.110.0470.04711.27
5.2.100.0500.05011.01
5.2.90.0700.05311.02
5.2.80.0730.05010.95
5.2.70.0530.05011.04
5.2.60.0530.05011.22
5.2.50.0430.04710.93
5.2.40.0470.05310.91
5.2.30.0570.04010.92
5.2.20.0530.04011.04
5.2.10.0470.03710.77
5.2.00.0470.04010.58
5.1.60.0570.0339.93
5.1.50.0470.03710.05
5.1.40.0530.02710.01
5.1.30.0370.04010.39
5.1.20.0430.03710.38
5.1.10.0430.0379.91
5.1.00.0500.03010.05
5.0.50.0100.0338.40
5.0.40.0200.0308.31
5.0.30.0300.0438.20
5.0.20.0230.0338.19
5.0.10.0300.0308.26
5.0.00.0230.0438.24
4.4.90.0130.0277.07
4.4.80.0270.0237.07
4.4.70.0270.0207.07
4.4.60.0230.0237.07
4.4.50.0300.0237.07
4.4.40.0230.0407.07
4.4.30.0170.0207.07
4.4.20.0100.0177.07
4.4.10.0030.0207.07
4.4.00.0070.0377.07
4.3.110.0000.0277.07
4.3.100.0000.0307.07
4.3.90.0330.0207.07
4.3.80.0300.0277.07
4.3.70.0200.0237.07
4.3.60.0130.0377.07
4.3.50.0300.0277.07
4.3.40.0300.0237.07
4.3.30.0130.0237.07
4.3.20.0170.0237.07
4.3.10.0070.0277.07
4.3.00.0100.0237.28

preferences:
27.3 ms | 403 KiB | 5 Q