3v4l.org

run code in 300+ PHP versions simultaneously
<?php class generateXML { public $dataArray = Array ( "name" => "Sunil", "age" => "21", "city" => "Gzb" ); function __construct() { $this->xmlCreate(); } function __destruct() { } function xmlCreate() { $doc = new DOMDocument('1.0'); $doc->formatOutput = true; $root = $doc->createElement('user'); $root = $doc->appendChild($root); foreach ($this->dataArray as $key => $value) { $title = $doc->createElement($key); $title = $root->appendChild($title); $text = $doc->createTextNode($value); $text = $title->appendChild($text); } echo $doc->saveXML() . "\n"; // echo "Document saved\n"; // echo "Saving only the title part:\n"; } } ?>

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.0140.00316.75
8.3.50.0090.00617.88
8.3.40.0070.00718.51
8.3.30.0140.00019.09
8.3.20.0040.00420.33
8.3.10.0040.00423.66
8.3.00.0080.00020.80
8.2.180.0110.00418.27
8.2.170.0080.00822.96
8.2.160.0170.00020.37
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0020.00522.08
8.2.110.0030.00622.32
8.2.100.0060.00617.42
8.2.90.0040.00418.95
8.2.80.0040.00417.97
8.2.70.0040.00417.38
8.2.60.0030.00517.78
8.2.50.0040.00818.07
8.2.40.0070.00418.22
8.2.30.0000.00718.19
8.2.20.0050.00317.48
8.2.10.0030.00617.97
8.2.00.0030.00517.50
8.1.270.0080.00023.96
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0100.00023.63
8.1.230.0040.00719.21
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.00
8.1.190.0030.00617.10
8.1.180.0000.00718.10
8.1.170.0040.00418.59
8.1.160.0040.00421.89
8.1.150.0080.00018.54
8.1.140.0070.00017.27
8.1.130.0000.00717.79
8.1.120.0000.00717.27
8.1.110.0050.00217.43
8.1.100.0000.00717.35
8.1.90.0000.00717.41
8.1.80.0040.00417.37
8.1.70.0030.00317.31
8.1.60.0040.00417.47
8.1.50.0040.00417.31
8.1.40.0030.00617.32
8.1.30.0000.00817.46
8.1.20.0000.00817.55
8.1.10.0000.00817.26
8.1.00.0050.00217.37
8.0.300.0000.00718.77
8.0.290.0040.00416.93
8.0.280.0070.00018.41
8.0.270.0000.00717.10
8.0.260.0030.00317.08
8.0.250.0080.00016.84
8.0.240.0080.00316.75
8.0.230.0030.00316.87
8.0.220.0040.00316.72
8.0.210.0000.00716.84
8.0.200.0030.00716.85
8.0.190.0050.00316.84
8.0.180.0000.00816.82
8.0.170.0050.00316.86
8.0.160.0000.00716.86
8.0.150.0030.00516.70
8.0.140.0000.00816.73
8.0.130.0030.00313.19
8.0.120.0000.00816.70
8.0.110.0070.00016.73
8.0.100.0070.00316.62
8.0.90.0040.00416.68
8.0.80.0130.00616.86
8.0.70.0000.00716.74
8.0.60.0040.00416.84
8.0.50.0040.00416.84
8.0.30.0110.00817.02
8.0.20.0090.00917.40
8.0.10.0040.00416.93
8.0.00.0060.01116.81
7.4.330.0000.00615.00
7.4.320.0000.00616.27
7.4.300.0000.00616.46
7.4.290.0070.00016.52
7.4.280.0070.00016.32
7.4.270.0000.00716.50
7.4.260.0000.00716.49
7.4.250.0070.00016.49
7.4.240.0050.00216.45
7.4.230.0030.00316.62
7.4.220.0070.01116.53
7.4.210.0100.00516.49
7.4.200.0000.00716.48
7.4.190.0030.00316.60
7.4.160.0120.00316.29
7.4.150.0170.00017.40
7.4.140.0120.00517.86
7.4.130.0100.00716.40
7.4.120.0070.01016.36
7.4.110.0150.00316.51
7.4.100.0080.01316.44
7.4.90.0140.00316.57
7.4.80.0100.01619.39
7.4.70.0060.01116.34
7.4.60.0050.01316.29
7.4.50.0000.00916.34
7.4.40.0070.01016.44
7.4.30.0130.00316.14
7.4.00.0050.01214.59
7.3.330.0050.00013.28
7.3.320.0030.00313.07
7.3.310.0000.00816.18
7.3.300.0000.00716.24
7.3.290.0060.00916.22
7.3.280.0070.01216.20
7.3.270.0100.00717.40
7.3.260.0090.00916.30
7.3.250.0110.00716.32
7.3.240.0060.01016.45
7.3.230.0110.00616.41
7.3.210.0100.00716.39
7.3.200.0000.01719.39
7.3.190.0220.00016.16
7.3.180.0110.00516.16
7.3.170.0080.00816.27
7.3.160.0060.00916.43
7.3.120.0030.01414.80
7.3.110.0120.00514.61
7.3.100.0000.01614.70
7.3.90.0060.00614.48
7.3.80.0070.00714.60
7.3.70.0100.00514.57
7.3.60.0080.00514.59
7.3.50.0060.00614.67
7.3.40.0040.00714.42
7.3.30.0050.00614.69
7.3.20.0050.00916.58
7.3.10.0080.00616.37
7.3.00.0070.00616.43
7.2.330.0110.00616.55
7.2.320.0150.00916.39
7.2.310.0090.01516.60
7.2.300.0100.00716.33
7.2.290.0060.01016.46
7.2.250.0070.01315.06
7.2.240.0030.01415.05
7.2.230.0070.01014.90
7.2.220.0030.01414.86
7.2.210.0050.01014.87
7.2.200.0070.00414.61
7.2.190.0070.00514.90
7.2.180.0030.01314.62
7.2.170.0060.00514.77
7.2.160.0070.01015.03
7.2.150.0060.00616.75
7.2.140.0060.00916.88
7.2.130.0070.00716.72
7.2.120.0070.00816.58
7.2.110.0060.00816.56
7.2.100.0070.00616.64
7.2.90.0050.01016.50
7.2.80.0060.01016.47
7.2.70.0050.01116.57
7.2.60.0130.00416.68
7.2.50.0140.00416.68
7.2.40.0100.00516.65
7.2.30.0040.01016.54
7.2.20.0090.00716.51
7.2.10.0040.01016.39
7.2.00.0080.00517.19
7.1.330.0050.01015.72
7.1.320.0070.00615.52
7.1.310.0040.00915.53
7.1.300.0070.00715.51
7.1.290.0070.00515.75
7.1.280.0070.00615.42
7.1.270.0050.01015.39
7.1.260.0090.00015.47
7.1.250.0050.00815.59
7.1.100.0030.00617.95
7.1.70.0000.00717.09
7.1.60.0040.01219.46
7.1.50.0160.00616.70
7.1.00.0030.07722.43
7.0.200.0000.00816.82
7.0.140.0070.07022.13
7.0.60.0070.06720.09
7.0.50.0130.04717.88
7.0.40.0200.07320.24
7.0.30.0330.04020.21
7.0.20.0330.06720.23
7.0.10.0070.08320.10
7.0.00.0000.04720.09
5.6.280.0000.07721.05
5.6.210.0100.04320.52
5.6.200.0070.06718.16
5.6.190.0030.04720.42
5.6.180.3630.03720.61
5.6.170.0170.04020.44
5.6.160.0070.08320.46
5.6.150.0070.08018.15
5.6.140.0030.04018.18
5.6.130.0070.06318.28
5.6.120.0070.04321.10
5.6.110.0030.09020.98
5.6.100.0100.03721.03
5.6.90.0100.07321.00
5.6.80.0070.04020.54
5.6.70.4570.04720.53
5.5.350.0270.06720.43
5.5.340.0100.04317.92
5.5.330.0030.05020.40
5.5.320.0370.07020.39
5.5.310.0170.04720.24
5.5.300.0030.08717.98
5.5.290.0100.03317.92
5.5.280.0130.08020.81
5.5.270.0030.04020.87
5.5.260.0170.06320.94
5.5.250.0070.07720.62
5.5.240.0170.07320.38
5.4.450.0830.04719.54
5.4.440.0730.04319.34
5.4.430.0770.04319.28
5.4.420.0670.06019.39
5.4.410.0730.05019.25
5.4.400.0600.05019.33
5.4.390.0270.06319.20
5.4.380.0170.05018.75
5.4.370.0230.04318.78
5.4.360.0070.05718.57
5.4.350.0070.06318.80
5.4.340.0130.05318.75
5.4.320.0080.04812.51
5.4.310.0140.03612.50
5.4.300.0130.05312.50
5.4.290.0070.05312.50
5.4.280.0140.05212.39
5.4.270.0110.03912.40
5.4.260.0110.03812.40
5.4.250.0030.04312.39
5.4.240.0080.03712.40
5.4.230.0080.05712.39
5.4.220.0090.04112.39
5.4.210.0100.05312.39
5.4.200.0110.05012.39
5.4.190.0070.05212.39
5.4.180.0170.05112.39
5.4.170.0150.06112.40
5.4.160.0070.03712.39
5.4.150.0100.03412.39
5.4.140.0060.03912.07
5.4.130.0100.04912.06
5.4.120.0100.03612.02
5.4.110.0100.03612.02
5.4.100.0060.04012.02
5.4.90.0070.03912.01
5.4.80.0100.03412.02
5.4.70.0090.03412.02
5.4.60.0080.03912.01
5.4.50.0070.03712.01
5.4.40.0110.04612.00
5.4.30.0080.04012.00
5.4.20.0080.04412.00
5.4.10.0110.05612.00
5.4.00.0050.04711.48
5.3.290.0050.04312.80
5.3.280.0060.04212.71
5.3.270.0110.06012.72
5.3.260.0090.04512.72
5.3.250.0080.03712.72
5.3.240.0100.03812.72
5.3.230.0080.04312.70
5.3.220.0060.05912.68
5.3.210.0080.04412.68
5.3.200.0110.03612.68
5.3.190.0160.03912.68
5.3.180.0200.06112.67
5.3.170.0070.04212.67
5.3.160.0060.03912.67
5.3.150.0130.05212.67
5.3.140.0120.04012.66
5.3.130.0090.04312.66
5.3.120.0100.05512.66
5.3.110.0080.05312.66
5.3.100.0100.04912.12
5.3.90.0100.05212.11
5.3.80.0190.05012.09
5.3.70.0090.05212.09
5.3.60.0120.04712.09
5.3.50.0120.07112.02
5.3.40.0110.04812.03
5.3.30.0080.05111.98
5.3.20.0100.05311.77
5.3.10.0070.03911.74
5.3.00.0070.04011.71
5.2.170.0090.0469.22
5.2.160.0080.0399.22
5.2.150.0050.0489.22
5.2.140.0120.0489.21
5.2.130.0100.0649.18
5.2.120.0080.0369.18
5.2.110.0070.0379.19
5.2.100.0090.0369.18
5.2.90.0080.0419.18
5.2.80.0090.0319.18
5.2.70.0040.0379.18
5.2.60.0090.0289.13
5.2.50.0050.0379.10
5.2.40.0100.0419.08
5.2.30.0080.0419.05
5.2.20.0050.0419.04
5.2.10.0070.0308.95
5.2.00.0050.0428.81
5.1.60.0050.0358.09
5.1.50.0060.0348.09
5.1.40.0070.0468.07
5.1.30.0100.0248.42
5.1.20.0070.0408.45
5.1.10.0060.0298.17
5.1.00.0060.0308.17
5.0.50.0050.0216.65
5.0.40.0050.0226.51
5.0.30.0030.0356.32
5.0.20.0060.0196.29
5.0.10.0050.0216.27
5.0.00.0060.0366.26
4.4.90.0040.0174.78
4.4.80.0060.0154.76
4.4.70.0060.0174.75
4.4.60.0110.0234.76
4.4.50.0100.0554.77
4.4.40.0070.0404.71
4.4.30.0060.0194.76
4.4.20.0080.0234.84
4.4.10.0060.0254.84
4.4.00.0060.0324.75
4.3.110.0070.0254.67
4.3.100.0050.0254.67
4.3.90.0010.0184.64
4.3.80.0140.0244.59
4.3.70.0050.0144.63
4.3.60.0030.0164.63
4.3.50.0050.0194.63
4.3.40.0070.0254.54
4.3.30.0040.0163.30
4.3.20.0030.0183.28
4.3.10.0040.0193.24
4.3.00.0130.0207.94

preferences:
64.83 ms | 400 KiB | 5 Q