3v4l.org

run code in 300+ PHP versions simultaneously
<?php class generateXML { private $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)
5.4.290.0040.04312.50
5.4.280.0060.03912.40
5.4.270.0110.03812.40
5.4.260.0070.04012.40
5.4.250.0070.03812.40
5.4.240.0090.03412.40
5.4.230.0060.04012.39
5.4.220.0070.03612.39
5.4.210.0060.03712.39
5.4.200.0090.03812.39
5.4.190.0080.03812.39
5.4.180.0080.03612.39
5.4.170.0030.04112.39
5.4.160.0080.04312.39
5.4.150.0070.03812.39
5.4.140.0060.03812.08
5.4.130.0080.03712.06
5.4.120.0070.03812.03
5.4.110.0070.03612.02
5.4.100.0060.03612.02
5.4.90.0080.03612.02
5.4.80.0090.03512.02
5.4.70.0120.03612.02
5.4.60.0060.03412.02
5.4.50.0060.03712.02
5.4.40.0050.03612.01
5.4.30.0070.03612.00
5.4.20.0100.03412.00
5.4.10.0080.04512.00
5.4.00.0050.03711.50
5.3.280.0060.04012.70
5.3.270.0050.04312.73
5.3.260.0070.04012.72
5.3.250.0120.03412.72
5.3.240.0080.03912.72
5.3.230.0030.04112.71
5.3.220.0090.03912.68
5.3.210.0070.05212.68
5.3.200.0060.04012.68
5.3.190.0060.03912.68
5.3.180.0060.04312.67
5.3.170.0120.03812.67
5.3.160.0060.03812.67
5.3.150.0070.03912.67
5.3.140.0040.04412.66
5.3.130.0080.04012.66
5.3.120.0090.03712.66
5.3.110.0070.03912.66
5.3.100.0100.03412.12
5.3.90.0060.03612.10
5.3.80.0050.03912.09
5.3.70.0050.03712.09
5.3.60.0060.03912.07
5.3.50.0090.03512.02
5.3.40.0090.03512.02
5.3.30.0090.03311.98
5.3.20.0100.03311.75
5.3.10.0080.04011.73
5.3.00.0060.03811.71
5.2.170.0060.0309.21
5.2.160.0020.0339.21
5.2.150.0080.0409.21
5.2.140.0040.0389.21
5.2.130.0050.0319.17
5.2.120.0040.0439.16
5.2.110.0060.0309.18
5.2.100.0060.0309.18
5.2.90.0070.0369.18
5.2.80.0050.0329.17
5.2.70.0070.0349.17
5.2.60.0050.0329.13
5.2.50.0060.0439.10
5.2.40.0070.0409.07
5.2.30.0060.0329.05
5.2.20.0090.0329.04
5.2.10.0050.0328.95
5.2.00.0060.0408.80
5.1.60.0050.0388.09
5.1.50.0080.0288.08
5.1.40.0050.0258.06
5.1.30.0050.0278.41
5.1.20.0040.0308.44
5.1.10.0080.0328.16
5.1.00.0050.0398.16
5.0.50.0030.0246.64
5.0.40.0030.0226.50
5.0.30.0070.0326.30
5.0.20.0040.0276.28
5.0.10.0060.0276.26
5.0.00.0060.0326.25
4.4.90.0040.0174.78
4.4.80.0030.0174.75
4.4.70.0050.0164.75
4.4.60.0040.0154.75
4.4.50.0050.0144.77
4.4.40.0040.0324.71
4.4.30.0020.0174.76
4.4.20.0040.0204.85
4.4.10.0200.0804.85
4.4.00.0030.0324.76
4.3.110.0060.0334.67
4.3.100.0070.0224.66
4.3.90.0060.0154.64
4.3.80.0040.0264.58
4.3.70.0060.0164.63
4.3.60.0060.0264.63
4.3.50.0050.0274.63
4.3.40.0080.0254.54
4.3.30.0020.0183.30
4.3.20.0070.0323.28
4.3.10.0010.0213.23
4.3.00.0100.0207.94

preferences:
141.38 ms | 1386 KiB | 7 Q