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.40.0120.00318.42
8.3.30.0110.00319.01
8.3.20.0050.00220.21
8.3.10.0000.00823.48
8.3.00.0000.00820.95
8.2.170.0040.01122.96
8.2.160.0000.01420.10
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0050.00222.21
8.2.110.0060.00319.45
8.2.100.0040.00817.78
8.2.90.0040.00419.09
8.2.80.0030.00517.97
8.2.70.0080.00017.38
8.2.60.0030.00617.90
8.2.50.0030.00618.07
8.2.40.0070.00317.97
8.2.30.0040.00418.06
8.2.20.0040.00417.57
8.2.10.0040.00417.93
8.2.00.0000.00817.58
8.1.270.0030.00522.14
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00620.93
8.1.230.0040.00817.42
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.10
8.1.190.0080.00017.10
8.1.180.0050.00318.88
8.1.170.0040.00418.46
8.1.160.0040.00421.98
8.1.150.0040.00418.57
8.1.140.0000.00717.24
8.1.130.0000.00717.90
8.1.120.0040.00417.26
8.1.110.0080.00017.36
8.1.100.0040.00417.30
8.1.90.0040.00417.32
8.1.80.0030.00517.35
8.1.70.0030.00317.22
8.1.60.0040.00417.38
8.1.50.0080.00017.41
8.1.40.0000.00717.34
8.1.30.0040.00417.45
8.1.20.0060.00317.41
8.1.10.0030.00617.44
8.1.00.0000.00717.33
8.0.300.0000.00718.77
8.0.290.0040.00416.59
8.0.280.0000.00718.33
8.0.270.0030.00317.10
8.0.260.0030.00317.22
8.0.250.0000.00616.75
8.0.240.0070.00316.80
8.0.230.0000.00716.84
8.0.220.0040.00416.69
8.0.210.0000.00716.71
8.0.200.0040.00416.85
8.0.190.0000.00816.87
8.0.180.0040.00416.80
8.0.170.0000.00816.91
8.0.160.0040.00416.79
8.0.150.0040.00416.70
8.0.140.0000.00716.68
8.0.130.0000.00613.27
8.0.120.0030.00516.70
8.0.110.0080.00016.68
8.0.100.0070.00016.82
8.0.90.0050.00216.81
8.0.80.0100.00716.79
8.0.70.0040.00416.80
8.0.60.0040.00416.77
8.0.50.0000.00816.69
8.0.30.0070.01116.93
8.0.20.0090.01017.40
8.0.10.0000.00716.95
8.0.00.0080.01216.56
7.4.330.0050.00015.03
7.4.320.0000.00616.43
7.4.300.0050.00216.53
7.4.290.0000.00716.43
7.4.280.0030.00316.55
7.4.270.0000.00716.41
7.4.260.0000.00716.31
7.4.250.0040.00416.48
7.4.240.0030.00516.52
7.4.230.0000.00716.30
7.4.220.0090.00916.48
7.4.210.0100.00616.44
7.4.200.0030.00316.53
7.4.190.0070.00016.57
7.4.160.0070.01016.47
7.4.150.0070.01117.40
7.4.140.0100.00717.86
7.4.130.0120.00616.41
7.4.120.0130.00816.48
7.4.110.0120.00616.51
7.4.100.0030.01316.37
7.4.90.0080.00916.44
7.4.80.0090.00919.39
7.4.70.0100.00316.53
7.4.60.0100.01016.07
7.4.50.0090.00016.03
7.4.40.0130.00316.30
7.4.30.0060.00916.55
7.4.00.0050.01314.96
7.3.330.0000.00613.20
7.3.320.0000.00513.05
7.3.310.0070.00016.21
7.3.300.0060.00016.18
7.3.290.0110.00716.19
7.3.280.0050.01116.26
7.3.270.0000.01617.40
7.3.260.0110.00716.24
7.3.250.0120.00816.28
7.3.240.0090.00616.43
7.3.230.0160.00016.39
7.3.210.0130.00316.32
7.3.200.0170.00316.48
7.3.190.0090.00916.26
7.3.180.0060.01016.24
7.3.170.0080.00816.27
7.3.160.0000.01616.26
7.3.120.0120.00314.69
7.3.110.0070.00614.75
7.3.100.0090.00614.70
7.3.90.0030.01414.77
7.3.80.0030.00914.64
7.3.70.0060.00314.51
7.3.60.0100.00314.71
7.3.50.0100.00314.80
7.3.40.0030.01014.60
7.3.30.0030.00614.76
7.3.20.0060.00316.35
7.3.10.0050.00816.58
7.3.00.0080.00616.52
7.2.330.0040.01416.55
7.2.320.0230.01416.52
7.2.310.0110.00616.55
7.2.300.0080.01116.53
7.2.290.0070.01016.58
7.2.250.0070.01014.80
7.2.240.0040.01514.93
7.2.230.0140.00315.07
7.2.220.0090.00614.84
7.2.210.0050.00814.82
7.2.200.0060.00614.84
7.2.190.0060.00914.65
7.2.180.0000.00914.62
7.2.170.0000.01415.00
7.2.130.0060.00916.65
7.2.120.0090.00316.59
7.2.110.0070.00316.52
7.2.100.0080.00816.69
7.2.90.0100.00316.38
7.2.80.0080.00516.29
7.2.70.0040.01116.81
7.2.60.0000.01016.67
7.2.50.0030.00716.71
7.2.40.0090.00416.41
7.2.30.0040.00416.39
7.2.20.0060.00616.68
7.2.10.0070.01016.72
7.2.00.0070.00716.51
7.1.330.0000.01315.60
7.1.320.0070.01015.61
7.1.310.0000.01615.59
7.1.300.0060.00615.50
7.1.290.0070.00715.55
7.1.280.0090.00315.54
7.1.270.0040.00415.42
7.1.260.0140.00015.29
7.1.250.0040.00715.55
7.1.200.0350.00415.14
7.1.70.0130.00816.77
7.1.60.0040.00817.27
7.1.50.0110.01416.77
7.1.00.0000.08022.28
7.0.200.0090.00916.46
7.0.140.0100.06721.95
7.0.60.0100.03319.88
7.0.50.0070.05017.85
7.0.40.0030.06020.24
7.0.30.0270.06020.15
7.0.20.0270.05020.24
7.0.10.0030.04720.08
7.0.00.0030.06720.09
5.6.280.0100.06721.15
5.6.210.0100.08020.60
5.6.200.0130.05718.17
5.6.190.0100.04320.57
5.6.180.0030.05320.52
5.6.170.0330.07320.71
5.6.160.0070.05320.50
5.6.150.0070.03718.23
5.6.140.0030.06018.24
5.6.130.0070.05718.15
5.6.120.0100.08020.91
5.6.110.0070.08721.08
5.6.100.0130.05321.00
5.6.90.0070.06721.02
5.6.80.0070.07720.38
5.5.350.3030.03320.43
5.5.340.0070.04017.95
5.5.330.0030.04320.31
5.5.320.0270.04320.32
5.5.310.0330.07020.34
5.5.300.0070.08317.98
5.5.290.0100.07717.94
5.5.280.0100.08020.77
5.5.270.0030.05320.88
5.5.260.0130.07720.96
5.5.250.0100.07320.70
5.5.240.0070.07020.20
5.4.450.0700.04719.33
5.4.440.0800.07019.12
5.4.430.0700.05319.66
5.4.420.0800.05319.31
5.4.410.1100.04719.27
5.4.400.0630.04719.23
5.4.390.0130.04719.16
5.4.380.0130.08018.48
5.4.370.0130.05718.56
5.4.360.0100.05318.59
5.4.350.0170.05018.54
5.4.340.0230.04318.79
5.4.320.0050.04812.51
5.4.310.0080.04112.50
5.4.300.0060.04112.50
5.4.290.0090.04112.50
5.4.280.0070.04112.40
5.4.270.0130.05812.40
5.4.260.0070.03812.39
5.4.250.0120.03412.39
5.4.240.0030.04012.40
5.4.230.0100.04312.39
5.4.220.0070.03712.39
5.4.210.0060.03612.39
5.4.200.0060.04012.39
5.4.190.0090.03812.39
5.4.180.0090.05112.39
5.4.170.0130.06312.40
5.4.160.0090.05212.39
5.4.150.0110.04412.39
5.4.140.0150.06412.07
5.4.130.0060.03812.06
5.4.120.0090.03812.02
5.4.110.0080.04012.02
5.4.100.0090.04812.02
5.4.90.0070.05412.02
5.4.80.0050.05812.02
5.4.70.0110.04912.01
5.4.60.0120.04312.01
5.4.50.0090.04112.02
5.4.40.0050.05312.00
5.4.30.0070.03812.00
5.4.20.0060.03812.00
5.4.10.0100.04012.00
5.4.00.0100.03711.48
5.3.290.0050.04112.80
5.3.280.0060.04112.71
5.3.270.0080.04412.72
5.3.260.0100.04712.72
5.3.250.0070.03912.72
5.3.240.0080.05512.72
5.3.230.0090.03812.71
5.3.220.0080.03812.68
5.3.210.0080.04112.68
5.3.200.0090.04312.68
5.3.190.0100.03712.68
5.3.180.0050.04212.68
5.3.170.0090.04212.66
5.3.160.0120.03712.67
5.3.150.0120.04212.68
5.3.140.0120.04912.66
5.3.130.0140.04812.66
5.3.120.0150.06612.66
5.3.110.0040.04212.66
5.3.100.0030.04412.12
5.3.90.0110.04412.11
5.3.80.0130.04312.09
5.3.70.0090.04712.09
5.3.60.0100.04812.08
5.3.50.0180.04812.02
5.3.40.0100.04512.03
5.3.30.0100.04311.98
5.3.20.0070.03611.77
5.3.10.0120.02911.74
5.3.00.0090.03611.71
5.2.170.0060.0359.22
5.2.160.0040.0339.22
5.2.150.0040.0319.22
5.2.140.0030.0349.21
5.2.130.0040.0319.17
5.2.120.0060.0309.17
5.2.110.0100.0359.18
5.2.100.0090.0399.18
5.2.90.0090.0349.18
5.2.80.0060.0459.18
5.2.70.0060.0379.18
5.2.60.0080.0319.13
5.2.50.0080.0329.10
5.2.40.0070.0309.07
5.2.30.0080.0289.05
5.2.20.0070.0289.04
5.2.10.0010.0328.95
5.2.00.0060.0338.81
5.1.60.0030.0358.09
5.1.50.0020.0288.09
5.1.40.0040.0378.07
5.1.30.0060.0258.42
5.1.20.0030.0368.44
5.1.10.0020.0298.16
5.1.00.0050.0268.16
5.0.50.0050.0206.65
5.0.40.0040.0206.51
5.0.30.0040.0326.32
5.0.20.0020.0216.29
5.0.10.0040.0206.27
5.0.00.0040.0306.26
4.4.90.0060.0134.78
4.4.80.0040.0144.76
4.4.70.0000.0194.76
4.4.60.0030.0174.76
4.4.50.0040.0154.77
4.4.40.0040.0244.70
4.4.30.0050.0154.75
4.4.20.0050.0154.84
4.4.10.0030.0174.85
4.4.00.0020.0284.76
4.3.110.0030.0214.67
4.3.100.0020.0164.66
4.3.90.0050.0164.63
4.3.80.0060.0304.59
4.3.70.0020.0164.63
4.3.60.0040.0204.63
4.3.50.0030.0164.62
4.3.40.0020.0264.54
4.3.30.0040.0153.30
4.3.20.0040.0163.28
4.3.10.0040.0213.24
4.3.00.0100.0277.94

preferences:
40.75 ms | 400 KiB | 5 Q