3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Created by PhpStorm. * User: efik * Date: 21.09.15 * Time: 13:28 */ $podcasts = []; foreach (range(1, 150) as $index) { $podcasts[] = [ "id" => $index * mt_rand(1, 4), "title" => "Song - " . $index, "time" => $index, "License" => "MIT", ]; } arsort($podcasts); $dom = new DOMDocument("1.0", "UTF-8"); $podcastDOM = $dom->createElement("podcast"); foreach ($podcasts as $podcast) { $item = $dom->createElement('song'); foreach ($podcast as $key => $value) { if ($key !== "title") { $currentKey = $dom->createAttribute($key); $currentKey->appendChild($dom->createTextNode($value)); } else { $item->appendChild($dom->createTextNode($value)); } $item->appendChild($currentKey); $podcastDOM->appendChild($item); } } $dom->appendChild($podcastDOM); header("Content-Type: text/xml"); echo $dom->saveXML();

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.0070.01315.16
7.3.120.0060.01615.45
7.3.110.0060.01514.87
7.3.100.0090.00615.23
7.3.90.0070.00415.26
7.3.80.0080.00315.18
7.3.70.0100.00615.11
7.3.60.0030.01315.19
7.3.50.0070.01015.41
7.3.40.0090.00915.05
7.3.30.0120.00315.31
7.3.20.0110.00716.73
7.3.10.0000.01617.21
7.3.00.0030.01017.05
7.2.250.0100.01015.20
7.2.240.0130.00715.43
7.2.230.0060.01015.31
7.2.220.0080.00815.42
7.2.210.0110.00715.48
7.2.200.0000.01615.43
7.2.190.0100.00715.41
7.2.180.0100.00615.49
7.2.170.0030.01215.36
7.2.00.0030.01419.57
7.1.330.0100.00715.96
7.1.320.0070.01016.24
7.1.310.0070.01316.20
7.1.300.0030.00915.93
7.1.290.0090.00616.07
7.1.280.0090.00615.91
7.1.270.0070.00716.25
7.1.260.0040.01416.21
7.1.70.0070.00717.65
7.1.60.0070.02119.13
7.1.50.0100.01717.51
7.1.00.0070.07722.67
7.0.200.0030.00717.12
7.0.60.0000.04320.22
7.0.50.0030.06718.16
7.0.40.0070.07020.41
7.0.30.0470.07320.29
7.0.20.0330.07320.30
7.0.10.0030.09020.10
7.0.00.0070.09020.09
5.6.280.0100.05021.29
5.6.210.0070.06721.06
5.6.200.0070.07318.50
5.6.190.0070.05720.68
5.6.180.0970.06720.54
5.6.170.0270.03720.75
5.6.160.0030.05320.73
5.6.150.0130.06018.45
5.6.140.0100.08018.44
5.6.130.0030.06018.56
5.6.120.0030.04321.39
5.6.110.0130.08321.54
5.6.100.0200.08021.51
5.6.90.0000.05021.55
5.6.80.0070.07320.79
5.6.70.4270.04020.87
5.5.350.0300.07020.68
5.5.340.0100.03318.32
5.5.330.0070.04320.48
5.5.320.0470.06720.68
5.5.310.0100.04720.46
5.5.300.0130.07718.28
5.5.290.0030.08718.32
5.5.280.0200.05321.20
5.5.270.0100.05721.05
5.5.260.0130.07321.09
5.5.250.0100.07320.99
5.5.240.0170.08020.56
5.4.450.0730.06319.54
5.4.440.0870.05019.98
5.4.430.0630.06019.80
5.4.420.0630.05719.82
5.4.410.0900.04719.70
5.4.400.0630.07019.66
5.4.390.0730.05719.50
5.4.380.0700.05319.20
5.4.370.0600.06319.51
5.4.360.0800.04019.39
5.4.350.0600.06319.41
5.4.340.0700.05319.45
5.4.320.0770.05019.37
5.4.310.0670.05019.62
5.4.300.0670.05319.59
5.4.290.0600.06019.48
5.4.280.0700.05719.65
5.4.270.0800.04019.47
5.4.260.0700.05019.68
5.4.250.0830.05319.27
5.4.240.0670.05319.38
5.4.230.0730.06319.46
5.4.220.0700.07019.23
5.4.210.0700.05019.61
5.4.200.0700.05319.28
5.4.190.0800.06019.49
5.4.180.0900.05719.29
5.4.170.0700.05719.38
5.4.160.0770.04719.35
5.4.150.0600.06319.61
5.4.140.0600.05716.75
5.4.130.0670.05016.60
5.4.120.0770.04016.64
5.4.110.0700.05716.53
5.4.100.0770.07316.83
5.4.90.0870.05016.45
5.4.80.0700.04716.43
5.4.70.0230.06316.55
5.4.60.0370.05716.71
5.4.50.0000.05016.75
5.4.40.0270.06716.68
5.4.30.0200.07316.41
5.4.20.0030.07316.63

preferences:
17.96 ms | 401 KiB | 5 Q